Li Jun
2022-04-21 03a6b8730cde75e4c42634b676c96dd9caeda07f
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
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>SendQIS</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>发送QIS到SPO</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <url>{!RequireScript(&quot;/soap/ajax/51.0/connection.js&quot;)} 
{!RequireScript(&quot;/resource/CommonUtilJs&quot;)} 
{!RequireScript(&quot;/soap/ajax/51.0/apex.js&quot;)} 
//2021-10-21 gwy 版本更改为51.0
var foo = function() {
 
if(&apos;{!QIS_Report__c.RecordTypeId}&apos; == &apos;01210000000RLWh&apos;){
   alert(&apos;记录类型是:&apos;+&apos;{!QIS_Report__c.RecordType}&apos;+&apos;,不能提交到SPO&apos;);
   return; 
}
if(!(&apos;{!$Profile.Id }&apos; == &apos;00e10000000Y3o5&apos; || &apos;{!$Profile.Id }&apos; == &apos;00e10000000xnnu&apos; || &apos;{!$Profile.Id }&apos; == &apos;00e10000000xno9&apos;)) {
    alert(&apos;没有权限提交,请联系系统管理员。&apos;);
    return; 
}
 
if(&apos;{!QIS_Report__c.IsSendQIS__c}&apos; == &apos;1&apos;){
    alert(&apos;已提交到SPO,请不要重复提交。&apos;);
    return;
}
/*var rac = new sforce.SObject(&quot;QIS_Report__c&quot;); 
rac.Id = &quot;{!QIS_Report__c.Id}&quot;; 
 
rac.IsSendQIS__c = true ;
 
var result = sforce.connection.update([rac]); 
var messages = getConnectDMLErrorMessages(result);
 
if (messages.length &gt; 0) { 
   alert(messages.join(&quot;\n&quot;)); 
    return;
}*/
var qrId = &apos;{!QIS_Report__c.Id}&apos;;
var rtn = sforce.apex.execute(&quot;QistoSPOWebService&quot;, &quot;sendSPO&quot;, {qrId:qrId});
if (rtn != &apos;OK&apos;) {
alert(rtn);
return;
alert(&apos;提交成功!请在SPO系统中完成退换货申请。&apos;); 
location.reload();
open(&quot;https://olympus.sharepoint.cn/sites/GSPWF/SitePages/HomePage.aspx&quot;);
 
}
 
foo();</url>
</WebLink>