涂煌豪
2022-05-17 c406cfcd9ce37fd43711bb12b3dae2b3bd120c49
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>QISAgree</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>QIS结果跟进完毕</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <url>{!RequireScript(&quot;/soap/ajax/51.0/connection.js&quot;)}
{!RequireScript(&quot;/resource/CommonUtilJs&quot;)} 
//2021-10-21 gwy 版本更改为51.0
if(&quot;{!QIS_Report__c.OwnerId}&quot; == &quot;{!$User.Id}&quot;) {
var rac = new sforce.SObject(&quot;QIS_Report__c&quot;);
rac.Id = &quot;{!QIS_Report__c.Id}&quot;;
rac.QIS_Status__c = &quot;完毕&quot;;
// 4.OSH回答完毕 ==&gt; 9.Final 完毕
if (&quot;{!QIS_Report__c.RecordTypeId}&quot; == &quot;01210000000RLgY&quot;) {
    rac.RecordTypeId = &quot;01210000000gFTH&quot;;
}
// 3.OSH ==&gt; 5.完毕
else {
    rac.RecordTypeId = &quot;01210000000RLcW&quot;;
}
var serverTimestamp = sforce.connection.getServerTimestamp(); 
rac.QIS_Complete_Day__c = serverTimestamp.timestamp; 
 
var result = sforce.connection.update([rac]);
var messages = getConnectDMLErrorMessages(result);
if (messages.length &gt; 0) {
    alert(messages.join(&quot;\n&quot;));
}
location.reload();
} else {
alert(&quot;只有所有者可以按QIS结果跟进完毕的按钮&quot;);
}</url>
</WebLink>