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