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
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>BeforeOPDPDFBtn_SIS</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>产品试用评价SIS</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <url>if (window.confirm(&apos;是否新建SIS报告书?&apos;)) {
                try {
                    sforce.connection.sessionId = &quot;{!GETSESSIONID()}&quot;;
                    var accid = &apos;{!Opportunity.AccountId}&apos;;
                    var recordType = &apos;SIS&apos;;
                    var repOwnerId = &apos;{!$User.Id}&apos;;
                    
                    var pdfno = sforce.apex.execute(&quot;ControllerUtil&quot;, &quot;selectCommonSequence&quot;, {valueField: &apos;EvaluationPDF_NextValue__c&apos;, formatField: &apos;EvaluationPDF_Format__c&apos;});
                    
                    //新建SIS报告书
                    var rtn = sforce.apex.execute(&quot;Add_Report&quot;, &quot;addReportOPWithEvaluationPDF&quot;, 
                        {repOwnerId: repOwnerId,
                         reportId: null,
                         dailyReportId: null,
                         eventId: null,
                         recordType: recordType,
                         aId: accid,
                         visitor1: null,
                         visitor2: null,
                         visitor3: null,
                         visitor4: null,
                         visitor5: null,
                         opp1: &apos;{!Opportunity.Id}&apos;,
                         opp2: null,
                         opp3: null,
                         opp4: null,
                         opp5: null,
                         reportDate: null,
                         evaluationPDFNumber: pdfno,
                         pro1: null
                        }
                    );
                    window.open(&apos;/apex/BeforeOPDPDF?oid=&apos; + &apos;{!Opportunity.Id}&apos; + &apos;&amp;pdfNo=&apos; + pdfno, &apos;BeforeOPDPDF&apos;);
                } catch(e) {
                    alert(e); 
                }
            } else {
                window.open(&apos;/apex/BeforeOPDPDF?oid=&apos; + &apos;{!Opportunity.Id}&apos;, &apos;BeforeOPDPDF&apos;);
            }</url>
</WebLink>