<?xml version="1.0" encoding="UTF-8"?> 
 | 
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>specSubmit</fullName> 
 | 
    <availability>online</availability> 
 | 
    <displayType>button</displayType> 
 | 
    <linkType>javascript</linkType> 
 | 
    <masterLabel>提交审批</masterLabel> 
 | 
    <openType>onClickJavaScript</openType> 
 | 
    <protected>false</protected> 
 | 
    <url>{!RequireScript("/soap/ajax/51.0/connection.js")}  
 | 
{!RequireScript("/soap/ajax/51.0/apex.js")}  
 | 
{!RequireScript("/resource/CommonUtilJs")}  
 | 
  
 | 
var foo = function() { 
 | 
  
 | 
  var reason = '{!OpportunitySpecialApply__c.Apply_Reason__c}';  
 | 
  var file = '{!OpportunitySpecialApply__c.Is_upload_file__c}'; 
 | 
  var status = '{!OpportunitySpecialApply__c.Status__c}'; 
 | 
  
 | 
  if((reason == '招标质疑'||reason == '取消招标')  && (file == false)){ 
 | 
    alert('请上传附件。'); 
 | 
    return; 
 | 
  } 
 | 
  if(status != '草案中'&& status != '驳回'){ 
 | 
    alert('当前状态无法提交审批。'); 
 | 
    return; 
 | 
  } 
 | 
  
 | 
  if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { 
 | 
    return; 
 | 
  } 
 | 
  
 | 
  var spec = new sforce.SObject('OpportunitySpecialApply__c');  
 | 
  
 | 
  spec.Id = '{!OpportunitySpecialApply__c.Id}';  
 | 
  spec.Status__c = '已提交'; 
 | 
  
 | 
  var result = sforce.connection.update([spec]);  
 | 
  var messages = getConnectDMLErrorMessages(result);  
 | 
  
 | 
  if (messages.length > 0) {  
 | 
  alert(messages.join("\n"));  
 | 
  return;  
 | 
    }  
 | 
  alert('审批提交成功。');  
 | 
  window.location.reload(); 
 | 
}; 
 | 
foo();</url> 
 | 
</WebLink> 
 |