<?xml version="1.0" encoding="UTF-8"?>
|
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
|
<fullName>CustomLink2Advance_Payment_Identification_Change</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")}
|
|
var foo = function() {
|
if ('{!Account.FirstParagraph__c}' == 0) {
|
alert("您已取消先款标识,无需重复操作");
|
return;
|
} else if ('{!Account.MonthlyPayment__c}' == true) {
|
alert("您不能进行特批,请先取消月度债权先款标识");
|
return;
|
} else {
|
var AcId = "{!Account.Id}";
|
var sql = "select id,Status__c from Advance_Payment__c where Account__c='" + AcId + "' and RecordType.Id='01210000000aMKy' and Status__c in (\'草案中\',\'已提交\',\'批准中\')";
|
var newRCPAED_IdList = sforce.connection.query(sql);
|
var records = newRCPAED_IdList.getArray("records");
|
if (records.length > 0) {
|
if (records[0].Status__c == '草案中') {
|
alert('已提交草稿请尽快提交审批');
|
} else {
|
alert('无法创建!已有未最终批准的数据');
|
};
|
} else {
|
window.open("https://ocsm.my.salesforce.com/a4x/e?retURL=%2Fa4x%2Fo&RecordType=01210000000aMKy&ent=01I10000001YrgJ&CF00N10000009HETA={!Account.Name}&CF00N10000009HETA_lkid={!Account.Id}");
|
//window.open("https://ocsm.my.salesforce.com/a4t/e?retURL=%2Fa4t%2Fo&RecordType=0121m000000wouy&CF00N1m000005eNIM={!Account.Name}&CF00N1m000005eNIM_lkid={!Account.Name}&ent=01I1m000000K82G")
|
};
|
}
|
|
|
}
|
foo();</url>
|
</WebLink>
|