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;
}
/**
地址,是否有风险,关联医院,驳回理由不传参数
+'&00N9D000006xnyF='+encodeURIComponent(Address)
+'&00N9D000007DA2t='+encodeURIComponent(WhetherRiskPassing)
+'&00N9D000007DBdw='+encodeURIComponent(RejectionReason)
+'&00N9D000007DCRc='+encodeURIComponent(AssociatedHospital)
*/
if(status == '有効'){
var url = '{!$Label.Environment_Url}'+'a5C/e?CF00N9D000006xntt='+encodeURIComponent(accname)
+'&CF00N9D000006xntt_lkid='+encodeURIComponent(accId)
+'&00N9D000006xnwn='+encodeURIComponent(accgrade)
+'&00N9D000007D8gG='+encodeURIComponent(accname)
+'&00N9D000006xnwT='+encodeURIComponent(AliasName2)
+'&00N9D000006xnwd='+encodeURIComponent(Abbreviation)
+'&00N9D000006xnws='+encodeURIComponent(AttributeType)
+'&00N9D000006xnx7='+encodeURIComponent(PostalCode)
+'&00N9D000006xnwx='+encodeURIComponent(SpecialityType)
+'&CF00N9D000006xnxb='+encodeURIComponent(StateMaster)
+'&CF00N9D000006xnxb_lkid='+encodeURIComponent(shengId)
+'&00N9D000006xny5='+encodeURIComponent(Town)
+'&CF00N9D000006xnxv='+encodeURIComponent(CityMaster)
+'&CF00N9D000006xnxv_lkid='+encodeURIComponent(shiId)
+'&00N9D000006xnyA='+encodeURIComponent(Street)
+'&00N9D000006xnxC='+encodeURIComponent(Field3companyname)
+'&00N9D000006xnwJ='+encodeURIComponent(Site)
+'&retURL='+ encodeURIComponent(accId);
window.top.location.href = url;
}else{
alert('该客户不在有效中,不可进行客户变更');
return;
}
}
foo();