Li Jun
2022-04-13 5c01ebbfddb6b8674430b47c22977bea2e350084
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
<?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;)} 
//2021-10-21 gwy 版本更改为51.0
var foo = function() {
  if (!confirm(&quot;不要报告后无法撤回,是否继续?&quot;)) {
    return;
  }
  if(&quot;{!Repair__c.OCSMAdministrativeReportNumber__c}&quot; != &quot;&quot; ||
     &quot;{!Repair__c.OCSMAdministrativeReportDate__c}&quot;  !=  &quot;&quot; ){
     alert(&quot;已经报告的QIS,不可以点击OCSM不要报告。&quot;);
     return;
  }
  if(&quot;{!Repair__c.Aware_date__c}&quot;  !=  &quot;&quot; ){
    var updateRe = new sforce.SObject(&quot;Repair__c&quot;); 
    updateRe.id = &quot;{!Repair__c.Id}&quot;;
    updateRe.OCSMAdministrativeReportStatus__c  = &apos;无需报告&apos;;
    sforce.connection.update([updateRe]);
    window.location.reload();
  }else{
    alert(&quot;没有AwareDate或已经OCSM行政报告,请确认。&quot;);
    return;
  }
};
foo();</url>
</WebLink>