binxie
2024-01-16 4d3febe8045eb0fa0283af3c53b0c48344b8664d
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>RepairRenew</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;/soap/ajax/51.0/apex.js&quot;)}
 
var buttons = document.getElementsByName(&apos;RepairRenew&apos;);
for (var i=0; i&lt;buttons.length; i++) {
    buttons[i].className = &quot;btnDisabled&quot;;
    buttons[i].disabled = true;
}
 
var foo = function() {
    sforce.connection.sessionId = &quot;{!GETSESSIONID()}&quot;;
    var raid = &quot;{!Rental_Apply__c.Id}&quot;;
    var retMessage = sforce.apex.execute(&quot;RentalApplyWebService&quot;, &quot;RepairRenewalCheck&quot;, {rentalApplyId: raid}); 
    if (retMessage != &apos;1&apos;) {
        alert(retMessage);
    } else {
        window.open(&apos;/apex/RepairRenewal?raid={!Rental_Apply__c.Id}&apos;);
    }
}
 
foo();</url>
</WebLink>