<?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("/soap/ajax/51.0/apex.js")}
|
{!RequireScript("/resource/CommonUtilJs")}
|
//2021-10-22 gwy 版本更改为51.0
|
var foo = function() {
|
if ("{!Report__c.Status__c}" == "取消") {
|
alert("已经取消!");
|
return;
|
}
|
if ("{!Report__c.Status__c}" == "批准") {
|
alert("已经批准,不能删除!");
|
return;
|
}
|
if ("{!Report__c.Status__c}" == "完毕") {
|
alert("已经完毕,不能删除!");
|
return;
|
}
|
if ("{!Report__c.Status__c}" == "提交") {
|
alert("已经提交,不能删除!");
|
return;
|
}
|
var rac = new sforce.SObject("Report__c");
|
rac.Id = "{!Report__c.Id}";
|
rac.Status__c = "取消";
|
var result = sforce.connection.update([rac]);
|
messages = getConnectDMLErrorMessages(result);
|
if (messages.length > 0) {
|
alert(messages.join("\n"));
|
return;
|
}
|
window.location.reload();
|
};
|
foo();</url>
|
</WebLink>
|