SI_Abort_Btn
online
massActionButton
javascript
终止SI需求表
onClickJavaScript
false
true
{!RequireScript("/soap/ajax/51.0/connection.js")}
{!RequireScript("/soap/ajax/51.0/apex.js")}
{!RequireScript("/resource/CommonUtilJs")}
//2021-10-21 gwy 版本更改为51.0
sforce.connection.sessionId = "{!GETSESSIONID()}";
var strid = {!GETRECORDIDS($ObjectType.IS_Opportunity_Demand__c)};
//alert(strid );
var decideFLG ='{!Opportunity.Estimation_Decision__c}';
var hasError ='0';
if(decideFLG ==true){
alert('报价已决定,不能终止');
hasError ='1';
}else{
var str=prompt("请输入终止理由"," ");
}
if (strid.length == 0) {
alert("请选择一个需求表。");
hasError = '1';
} else if (strid.length > 1) {
alert("只能选择一个需求表。");
hasError = '1';
}
var ids= '';
if (hasError == '0') {
ids+= strid[0];
var id = '{!IS_Opportunity_Demand__c.Id}';
try{
var rtn = sforce.apex.execute("ControllerUtil", "setAbortSI", {isoID:ids,AbortReason:str});
if(rtn!='Fin'){
alert(rtn);
}else{
window.top.location.reload();
}
}catch(e){
alert(e);
}
}