<?xml version="1.0" encoding="UTF-8"?> 
 | 
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>Cancel</fullName> 
 | 
    <availability>online</availability> 
 | 
    <displayType>button</displayType> 
 | 
    <linkType>javascript</linkType> 
 | 
    <masterLabel>取消</masterLabel> 
 | 
    <openType>onClickJavaScript</openType> 
 | 
    <protected>false</protected> 
 | 
    <url>{!RequireScript("/soap/ajax/51.0/connection.js")} 
 | 
{!RequireScript("/resource/CommonUtilJs")}  
 | 
//2021-10-21 gwy 版本更改为51.0 
 | 
if("{!Visit_Report__c.OwnerId}" == "{!$User.Id}" && "{!Visit_Report__c.Status__c}" == "草案中"){ 
 | 
    var rac = new sforce.SObject("Visit_Report__c"); 
 | 
    rac.Id = "{!Visit_Report__c.Id}"; 
 | 
    rac.Status__c = "取消";  
 | 
  
 | 
  
 | 
    if (messages.length > 0) { 
 | 
        alert(messages.join("\n")); 
 | 
    } 
 | 
    location.reload(); 
 | 
} else { 
 | 
alert("只草案中状态及同行报告书的所有人可以取消"); 
 | 
}</url> 
 | 
</WebLink> 
 |