Li Jun
2022-04-21 ca7998ae82d116f177e7a1f26e99a57346069102
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>OSH_Recieved</fullName>
    <availability>online</availability>
    <description>2018.8.24增加OSH负责部长审批流(LZHU-B3T52B)</description>
    <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; &amp;&amp; &apos;{!QIS_Report__c.QIS_Status__c}&apos; != &apos;完毕&apos;) { 
    alert(&apos;OSH已经收到实物&apos;); 
} else {
var rac = new sforce.SObject(&quot;QIS_Report__c&quot;);
rac.Id = &quot;{!QIS_Report__c.Id}&quot;;
rac.QIS_Status__c = &quot;OSH检测中&quot;;
var serverTimestamp = sforce.connection.getServerTimestamp();
rac.OSHRecievedDate__c = serverTimestamp.timestamp;
rac.OSH_Receive_staff__c = &quot;{!$User.Alias}&quot;;
rac.OSH_staff__c = &quot;{!$User.Alias}&quot;;
rac.OSH_staff_email__c = &quot;{!$User.Email}&quot;;
rac.Is_ProductGot__c = true; 
rac.OSH_GotProductPeople__c = &quot;{!$User.Id}&quot;; 
var resultSet = sforce.connection.query(&quot;SELECT Id, JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = &apos;{!$User.Id}&apos;&quot;); 
var records = resultSet.getArray(&quot;records&quot;); 
if (records != null &amp;&amp; records.length &gt; 0 &amp;&amp; records[0].JingliApprovalManager__c != null&amp;&amp; records[0].BuchangApprovalManager__c != null) { 
rac.OSH_Manager__c= records[0].JingliApprovalManager__c; 
rac.OSH_Buzhang__c= records[0].BuchangApprovalManager__c; 
} else { 
rac.OSH_Manager__c= &quot;{!$User.Id}&quot;;
rac.OSH_Buzhang__c= &quot;{!$User.Id}&quot;;
}
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>