Li Jun
2022-05-10 51fb56f3f5b0dc96d7f93a71f9b61263e303243f
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>returnDeliverySlip</fullName>
    <availability>online</availability>
    <description>到回寄单画面</description>
    <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;/soap/ajax/51.0/apex.js&quot;)}; 
//2021-10-22 gwy 版本更改为51.0
var query = &quot;Select Id,Name From Rental_Apply_Equipment_Set_Detail__c WHERE Received_Confirm_F__c=&apos;NG&apos; and Cancel_Select__c = false and Rental_Apply__c =&apos;{!Rental_Apply__c.Id}&apos;&quot;; 
var records = sforce.connection.query(query).getArray(&apos;records&apos;); 
var check = records &amp;&amp; records.length &gt; 0;
 
var foo = function() {
if ((check || {!Rental_Apply__c.Rental_Apply_Equipment_Set_Cnt__c} - {! Rental_Apply__c.Loaner_received_ng_num__c} &gt; 0) &amp;&amp; {! Rental_Apply__c.Rental_Apply_Equipment_Set_Cnt__c} &gt; 0) {
window.open(&quot;/apex/EquipmentSetShippmentReceived4?id={!Rental_Apply__c.Name}&quot;);
} else {
alert(&quot;没有申请者收到确认的借出备品&quot;);
}
}
foo();</url>
</WebLink>