binxie
2023-06-20 6d14c34d9a4e304bf3289e4ad957b091f27ef3b8
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>OCSMNoToReport</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;)} 
 
var foo = function() {
  if (!confirm(&quot;不要报告后无法撤回,是否继续?&quot;)) {
    return;
  }
  if(&quot;{!QIS_Report__c.OCSMAdministrativeReportNumber__c}&quot; != &quot;&quot; ||
     &quot;{!QIS_Report__c.OCSMAdministrativeReportDate__c}&quot;  !=  &quot;&quot; ){
     alert(&quot;已经报告的QIS,不可以点击OCSM不要报告。&quot;);
     return;
  }
  if(&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>