AccountDelayApply
online
massActionButton
javascript
新建客户变更申请
onClickJavaScript
false
true
{!REQUIRESCRIPT("/soap/ajax/51.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/51.0/apex.js")};
{!RequireScript("/resource/CommonUtilJs")}
var foo = function() {
var accId = '{!Account.Id}';
var accname = '{!Account.Name}';
var status = '{!Account.Is_Active__c}';
var accgrade = '{!Account.Grade__c}';
var AliasName2 = '{!Account.Alias_Name2__c}';
var Abbreviation = '{!Account.Abbreviation__c}';
var AttributeType= '{!Account.Attribute_Type__c}';
var PostalCode = '{!Account.Postal_Code__c}';
var SpecialityType = '{!Account.Speciality_Type__c}';
var StateMaster = '{!Account.State_Master__c}';
var Town = '{!Account.Town__c}';
var CityMaster = '{!Account.City_Master__c}';
var Address = '{!Account.Address__c}';
var Street = '{!Account.Street__c}';
var Field3companyname = '{!Account.Field3_companyname__c}';
var WhetherRiskPassing = '{!Account.WhetherRiskPassing__c}';
var RejectionReason = '{!Account.RejectionReason__c}';
var AssociatedHospital = '{!Account.AssociatedHospital__c}';
var Site = '{!Account.Site}';
var shengId = '{!Account.State_MasterId__c}';
var shiId = '{!Account.City_MasterId__c}';
var AccQuery = "select id from Account_Delay_Apply__c where Is_Active__c = '申请中' and Hospital__c = '"+accId+"'";
var acc = sforce.connection.query(AccQuery);
var AccSize = acc.size;
if (AccSize > 0){
alert("存在申请中的客户变更申请,无法再次提交变更申请。");
return;
}
if(status == '有効'){
var url = '{!$Label.Environment_Url}'+'a5A/e?CF00N10000009I0o1='+encodeURIComponent(accname)
+'&CF00N10000009I0o1_lkid='+encodeURIComponent(accId)
+'&00N10000009I0oP='+encodeURIComponent(accgrade)
+'&00N10000009I0oR='+encodeURIComponent(accname)
+'&00N10000009I0oA='+encodeURIComponent(AliasName2)
+'&00N10000009I0o8='+encodeURIComponent(Abbreviation)
+'&00N10000009I0oF='+encodeURIComponent(AttributeType)
+'&00N10000009I0oY='+encodeURIComponent(PostalCode)
+'&00N10000009I0ol='+encodeURIComponent(SpecialityType)
+'&CF00N10000009I0on='+encodeURIComponent(StateMaster)
+'&CF00N10000009I0on_lkid='+encodeURIComponent(shengId)
+'&00N10000009I0os='+encodeURIComponent(Town)
+'&CF00N10000009I0oI='+encodeURIComponent(CityMaster)
+'&CF00N10000009I0oI_lkid='+encodeURIComponent(shiId)
+'&00N10000009I0op='+encodeURIComponent(Street)
+'&00N10000009I0oN='+encodeURIComponent(Field3companyname)
+'&00N10000009I0oj='+encodeURIComponent(Site)
+'&retURL='+ encodeURIComponent(accId);
window.top.location.href = url;
}else{
alert('该客户不在有效中,不可进行客户变更');
return;
}
}
foo();