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
39
40
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Monthly_Claims_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;)}
var foo = function() {
    var ssc = &apos;{!Account.DealerTypeSum__c }&apos;;
    if (ssc == &apos;特约经销商&apos;) {
        if ({!Account.MonthlyPayment__c } == true) {
            var AcId = &quot;{!Account.Id}&quot;;
            var sql = &quot;select id,Status__c from Advance_Payment__c where Account__c=&apos;&quot; + AcId + &quot;&apos; and RecordType.Id=&apos;01210000000aML3&apos; and Status__c in (\&apos;草案中\&apos;,\&apos;已提交\&apos;,\&apos;批准中\&apos;)&quot;;
            var newRCPAED_IdList = sforce.connection.query(sql);
            var records = newRCPAED_IdList.getArray(&quot;records&quot;);
            if (records.length &gt; 0) {
                if (records[0].Status__c == &apos;草案中&apos;) {
                    alert(&apos;已提交草稿请尽快提交审批&apos;);
                } else {
                    alert(&apos;无法创建!已有未最终批准的数据&apos;);
                };
            } else {
                window.open(&quot;https://ocsm.my.salesforce.com/a4x/e?retURL=%2Fa4x%2Fo&amp;RecordType=01210000000aML3&amp;ent=01I10000001YrgJ&amp;CF00N10000009HETA={!Account.Name}&amp;CF00N10000009HETA_lkid={!Account.Id}&quot;);
                //window.open(&quot;https://ocsm.my.salesforce.com/a4t/e?retURL=%2Fa4t%2Fo&amp;RecordType=0121m000000wov3&amp;CF00N1m000005eNIM={!Account.Name}&amp;CF00N1m000005eNIM_lkid={!Account.Id}&amp;ent=01I1m000000K82G&quot;);
            }
        } else {
            alert(&quot;您已取消月度标识,无需重复操作&quot;);
        };
    } else {
        alert(&quot;请联系服务本部审核后变更标识&quot;);
        return;
    }
}
foo();</url>
</WebLink>