涂煌豪
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>OSH_Inspect</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>OSH检查受理</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 (&apos;{!QIS_Report__c.QIS_Status__c}&apos; != &apos;OSH检测中&apos;) {
    alert(&quot;需要先点击[OSH现品收到]&quot;);
} else if (&apos;{!QIS_Report__c.OSHInspectionDate__c}&apos; != &apos;&apos;) {
    alert(&quot;OSH检测已经受理&quot;);
} else {
    var rac = new sforce.SObject(&quot;QIS_Report__c&quot;); 
    rac.Id = &quot;{!QIS_Report__c.Id}&quot;; 
    var serverTimestamp = sforce.connection.getServerTimestamp(); 
    rac.OSHInspectionDate__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();
}</url>
</WebLink>