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