binxie
2024-01-20 e0de9222da210f9c8eb1a9f5400f936a14923e11
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>toBatchUser</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>变更所有者到Batch</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 foo = function() {
    if (&apos;{!$Profile.Id}&apos; != &quot;00e10000000Y3o5&quot;) {
        alert(&quot;你没有操作权限&quot;);
        return;
    }
    if (!confirm(&quot;无效客户的所有人将变为Batch User,请确认需要转移的信息是否都转移完毕。\n是否继续?&quot;)) {
        return;
    }
    var hpid = &apos;{!Account.Id}&apos;;
    var rtn = sforce.apex.execute(&quot;AccountWebService&quot;, &quot;toBatchOwner&quot;, {hpid:hpid});
    if (rtn != &apos;OK&apos;) {
        alert(rtn);
        return;
    }
    
    alert(&quot;无效客户的所有人已变为Batch User&quot;);
    window.location.reload();
}
foo();</url>
</WebLink>