binxie
2024-01-20 1d91be0be5220ce19ee64de5a5c9a8237b1c15b1
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Predicted_Date_Change</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>修改预测日</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <url>{!REQUIRESCRIPT(&quot;/soap/ajax/51.0/connection.js&quot;)};
{!REQUIRESCRIPT(&quot;/soap/ajax/51.0/apex.js&quot;)};
{!RequireScript(&quot;/resource/CommonUtilJs&quot;)};
 
function foo(){
// 20221206 ljh DB202212030068 start
//var DirectLossFLG = &apos;{!Opportunity.DirectLossFLG__c}&apos;;
//var CreatedDay = &apos;{!Opportunity.Created_Day__c}&apos;;
//var Day = &apos;{!DATE(2022,12,03)}&apos;;
//if((DirectLossFLG == &apos;true&apos; || DirectLossFLG == 1 ) &amp;&amp; CreatedDay &gt; Day){
//    alert(&apos;从招标项目点击失单新建的询价,预测OCSM签约日(KPI)和预测发货日不允许修改&apos;);
//    return;
//}
// 20221206 ljh DB202212030068 end
var sql = &quot;select id from InquiryPredictsDateChange__c where Predicted_Date_Status__c = &apos;审批中&apos; and Opportunity__c =&apos;&quot; + &apos;{!Opportunity.Id}&apos;+ &quot;&apos;&quot;;
var sqlResult = sforce.connection.query(sql);
 
if (sqlResult.size &gt; 0) {
alert(&apos;已存在待审批的变更申请!&apos;);
return;
} else {
window.open(&apos;/apex/ImprovedForecastTime?id={!Opportunity.Id}&apos;,&apos;&apos;,&apos;height=500,width=800,top=200,left=250,location=no&apos;);
 
}
}
 
 
foo();</url>
</WebLink>