| <?xml version="1.0" encoding="UTF-8"?> | 
| <WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> | 
|     <fullName>VOCFinish</fullName> | 
|     <availability>online</availability> | 
|     <displayType>button</displayType> | 
|     <linkType>javascript</linkType> | 
|     <masterLabel>VOC完毕</masterLabel> | 
|     <openType>onClickJavaScript</openType> | 
|     <protected>false</protected> | 
|     <url>{!RequireScript("/soap/ajax/51.0/connection.js")} | 
| {!RequireScript("/resource/CommonUtilJs")}  | 
| //2021-10-22 gwy 版本更改为51.0 | 
| var foo = function() { | 
|     if ("{!$User.Id}" != "00510000000gWAE" && "{!$User.Id}" != "00510000004reg2" && "{!$Profile.Id}" != "00e10000000Y3o5") { | 
|         alert("你没有完毕VOC的权限"); | 
|         return; | 
|     } | 
|     if ("{!Report__c.Status__c}" != "结果确认完毕") { | 
|         alert("不是结果确认完毕不能点击"); | 
|         return; | 
|     } | 
|     if ({!Report__c.JudgmentResult__c} == true) { | 
|         alert("判定还没结束,不能关闭VOC!"); | 
|         return; | 
|     } | 
|     var rac = new sforce.SObject("Report__c"); | 
|     rac.Id = "{!Report__c.Id}"; | 
|     rac.Status__c = "完毕"; | 
|     //rac.VOC_Finish__c = true; | 
|     var result = sforce.connection.update([rac]); | 
|     var messages = getConnectDMLErrorMessages(result); | 
|     if (messages.length > 0) { | 
|         alert(messages.join("\n")); | 
|         return; | 
|     } | 
|     location.reload(); | 
| } | 
| foo();</url> | 
| </WebLink> |