涂煌豪
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>SI_Abort_Btn</fullName>
    <availability>online</availability>
    <displayType>massActionButton</displayType>
    <linkType>javascript</linkType>
    <masterLabel>终止SI需求表</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <requireRowSelection>true</requireRowSelection>
    <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
sforce.connection.sessionId = &quot;{!GETSESSIONID()}&quot;;
var strid = {!GETRECORDIDS($ObjectType.IS_Opportunity_Demand__c)};
//alert(strid );
var decideFLG =&apos;{!Opportunity.Estimation_Decision__c}&apos;;
var hasError =&apos;0&apos;;
if(decideFLG ==true){
alert(&apos;报价已决定,不能终止&apos;);
hasError =&apos;1&apos;;
}else{
var str=prompt(&quot;请输入终止理由&quot;,&quot; &quot;);
}
if (strid.length == 0) {
alert(&quot;请选择一个需求表。&quot;);
hasError = &apos;1&apos;;
} else if (strid.length &gt; 1) {
alert(&quot;只能选择一个需求表。&quot;);
hasError = &apos;1&apos;;
}
var ids= &apos;&apos;;
if (hasError == &apos;0&apos;) {
ids+= strid[0];
var id =  &apos;{!IS_Opportunity_Demand__c.Id}&apos;;
try{
var rtn = sforce.apex.execute(&quot;ControllerUtil&quot;, &quot;setAbortSI&quot;, {isoID:ids,AbortReason:str});
if(rtn!=&apos;Fin&apos;){
alert(rtn);
}else{
window.top.location.reload(); 
}
}catch(e){
alert(e);
}
}</url>
</WebLink>