高章伟
2022-03-10 8db20630a2675ca14e03ccdee91c614397b5c964
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>CustomDelete_test</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>删除_test</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;)}
//2021-10-21 gwy 版本更改为51.0
var results = sforce.connection.query(&quot;SELECT Id, Status__c,SAP_Transfer_time__c, Repair_Ordered_Date__c, CreatedById, Acc_OwnerId__c,FSE_ownerid__c,FSE_ApplyForRepair_time__c FROM Repair__c WHERE Id = &apos;{!Repair__c.Id}&apos;&quot;); 
var repList = results.getArray(&quot;records&quot;); 
if (repList != null &amp;&amp; repList.length &gt; 0) {
var rp = repList[0];
 
 
    if (confirm(&quot;是否确定?&quot;)) {
    var rtn = sforce.apex.execute(&quot;ControllerUtil&quot;,&quot;deleteRepair&quot;,{rid:rp.Id});
    if (rtn == &quot;OK&quot;) {
        window.location.href = &quot;/a0J/o&quot;;
    } else {
        alert(rtn);
    }
   }
}</url>
</WebLink>