New_SI_Custom online massActionButton javascript 新建SI需求表(Old) 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 var foo = function(){ var records = new Array(); if('{!Opportunity.RecordTypeId}'=='012100000006KMe'){ var result = sforce.connection.query("select id from IS_Opportunity_Demand__c where Opportunity_ID__c= '{!Opportunity.Id}' and Func_SOD_Status__c !='00 已终止'"); records = result.getArray("records"); } var RecordTypeid = '{!JSENCODE(Opportunity.RecordTypeId)}'; if(RecordTypeid=='012100000006KMe'&&records.length==0){ //SI业务系统流程改善和提升项目 取消等级限制 2019-10-28 start //if('{!JSENCODE(Text(Opportunity.Competitor__c))}'=='D'||'{!JSENCODE(Text(Opportunity.Competitor__c))}'=='E'||'{!JSENCODE(Text(Opportunity.Competitor__c))}'=='その他'){ //alert('询价阶段“C”以下的询价,不需要创建SI需求表'); //}else{ var url = "apex/ISO_DemandOperAndDemons?OppoerID={!URLENCODE(Opportunity.Id)}"; window.top.location.href=url; //} //SI业务系统流程改善和提升项目 2019-10-28 end }else if('{!Opportunity.RecordTypeId}'!='012100000006KMe'){ alert("非SI询价,不能新建SI需求表"); } else if(RecordTypeid=='012100000006KMe'&&records.length!=0){ alert("存在已有的SI需求表,不能新建SI需求表"); } } foo();