涂煌豪
2022-05-06 ff435968945d457f9ee653a9620fa1c7d78d2d4c
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>CustomLink</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-21 gwy 版本更改为51.0
var foo = function() {
   var Status = &quot;{!OPDPlan__c.Status__c}&quot;;
   if(Status == &apos;取消&apos; || Status == &apos;完毕&apos; ){
      alert(&apos;OPD计划的状态为取消或完毕时,不能取消&apos;);
      return;
   }
   //判断符合条件得备品借出申请 SWAG-BUF6J5 
   var opdplanid = &apos;{!OPDPlan__c.Id}&apos;;    
   var rtn = sforce.apex.execute(&quot;OpdPlanWebService&quot;, &quot;changeTrade&quot;,{opdplanId:opdplanid});
   if (rtn != &apos;OK&apos;) {
     alert(rtn);
     return;
   }
   window.open(&apos;/a3D/e?CF00N10000008ps4s={!OPDPlan__c.Name}&amp;00N10000008ps4u=取消&amp;RecordType=01210000000gQyL&apos;);
}
foo();</url>
</WebLink>