Li Jun
2022-04-19 2f183a6b0a83ec3f7d35375d5d25d200efc2a3e1
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>OCSMToReport</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>OCSM要报告</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;)}; 
{!RequireScript(&quot;/resource/CommonUtilJs&quot;)} 
//2021-10-21 gwy 版本更改为51.0
var foo = function() {
if (!confirm(&quot;报告后无法撤回,是否继续?&quot;)) {
return;
}
  if(&quot;{!QIS_Report__c.OCSMAdministrativeReportStatus__c}&quot; == &quot;&quot; &amp;&amp;
     &quot;{!QIS_Report__c.Aware_date__c}&quot;  !=  &quot;&quot; ){
    var updateRe = new sforce.SObject(&quot;QIS_Report__c&quot;); 
    updateRe.id = &quot;{!QIS_Report__c.Id}&quot;;
    updateRe.OCSMAdministrativeReportStatus__c  = &apos;待报告&apos;;
    var result = sforce.connection.update([updateRe]);
    var messages = getConnectDMLErrorMessages(result);
    if (messages.length &gt; 0) {
      alert(messages.join(&quot;\n&quot;));
      return;
    }
    window.location.reload();
  }else{
    alert(&quot;没有AwareDate或已经OCSM行政报告,请确认。&quot;);
    return;
  }
};
foo();</url>
</WebLink>