涂煌豪
2022-05-06 ff435968945d457f9ee653a9620fa1c7d78d2d4c
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Cancel_submit</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;/resource/CommonUtilJs&quot;)} 
//2021-10-21 gwy 版本更改为51.0
 
if(&quot;{!Monthly_Report__c.OwnerId}&quot; == &quot;{!$User.Id}&quot;) { 
var rac = new sforce.SObject(&quot;Monthly_Report__c&quot;); 
rac.Id = &quot;{!Monthly_Report__c.Id}&quot;; 
rac.Status__c = &quot;草案中&quot;; 
rac.Submit_check_flag__c = &quot;false&quot;; 
rac.RecordTypeId = &quot;01210000000Qggf&quot;; 
rac.Submit_time__c = null; 
 
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;只周报的所有人可以取消&quot;); 
}</url>
</WebLink>