Li Jun
2022-05-11 b776940205e893302f77d24c4285613f228b44c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?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(&quot;/soap/ajax/51.0/connection.js&quot;)}; 
{!REQUIRESCRIPT(&quot;/soap/ajax/51.0/apex.js&quot;)}; 
{!RequireScript(&quot;/resource/CommonUtilJs&quot;)}
//2021-10-22 gwy 版本更改为51.0
function SubmitForApprovalPage(){
   var mcId= &quot;{! Maintenance_Contract__c.Id}&quot;;
var sql= &quot;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 = &apos;&quot; + mcId+ &quot;&apos;&quot;;
   var newRCPAED_IdList = sforce.connection.query(sql);
   var records = newRCPAED_IdList.getArray(&quot;records&quot;); 
   var url = &apos;&apos;;
   if (records.length&gt;0){
       url = &quot;/apex/SubmitForApprovalPage?id=&quot;+records[0].Id ;
   } else {
      url = &quot;/apex/SubmitForApprovalPage?mcId=&quot;+mcId;
   }
 
 
window.open (url, &apos;&apos;, &apos;height=350, width=600, top=200, left=350,location=no&apos;);
}
SubmitForApprovalPage();</url>
</WebLink>