| <?xml version="1.0" encoding="UTF-8"?> | 
| <WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> | 
|     <fullName>SubmitForApproval</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")} | 
| //2021-10-22 gwy 版本更改为51.0 | 
| function SubmitForApprovalPage(){ | 
|    var mcId= "{! Maintenance_Contract__c.Id}"; | 
| var sql= "SELECT id,Status__c,Other_Reasons__c,Other__c,Third_Party_Company__c,Third_Party_Contract_Price__c,To_Where__c,Specific_Reasons__c,Maintenance_Contract__c from Lost_Report__c where Maintenance_Contract__c = '" + mcId+ "'"; | 
|    var newRCPAED_IdList = sforce.connection.query(sql); | 
|    var records = newRCPAED_IdList.getArray("records");  | 
|    var url = ''; | 
|    if (records.length>0){ | 
|        url = "/apex/SubmitForApprovalPage?id="+records[0].Id ; | 
|    } else { | 
|       url = "/apex/SubmitForApprovalPage?mcId="+mcId; | 
|    } | 
|   | 
|   | 
| window.open (url, '', 'height=350, width=600, top=200, left=350,location=no'); | 
| } | 
| SubmitForApprovalPage();</url> | 
| </WebLink> |