<?xml version="1.0" encoding="UTF-8"?> 
 | 
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>New_SI_Custom</fullName> 
 | 
    <availability>online</availability> 
 | 
    <displayType>massActionButton</displayType> 
 | 
    <linkType>javascript</linkType> 
 | 
    <masterLabel>新建SI需求表(Old)</masterLabel> 
 | 
    <openType>onClickJavaScript</openType> 
 | 
    <protected>false</protected> 
 | 
    <requireRowSelection>true</requireRowSelection> 
 | 
    <url>{!RequireScript("/soap/ajax/51.0/connection.js")}  
 | 
{!RequireScript("/soap/ajax/51.0/apex.js")}  
 | 
{!RequireScript("/resource/CommonUtilJs")}  
 | 
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();</url> 
 | 
</WebLink> 
 |