when click on the new contact button (this is list view javascript custom button) page redirected but account name not populated automatically
var qc = sforce.connection.query("SELECT Id FROM RecordType WHERE SobjectType ='" + "Contact" + "'" +" AND DeveloperName = '"+"Suppliers"+ "'");
var qc_records = qc.getArray("records");
var qc_rec = qc.records.Id;
var qc1 = sforce.connection.query("SELECT Id FROM RecordType WHERE SobjectType ='" + "Contact" + "'" +" AND DeveloperName = '"+"Employee"+ "'");
var qc_records1 = qc1.getArray("records");
var qc_rec1 = qc1.records.Id;
if('{! Account.Status__c }' == 'Creditor' ||'{! Account.Status__c }' == 'Debitor' ||'{! Account.Status__c }' == 'Other External' )
{
returnUrl = "/003/e?retURL=%2F{! Account.Id }&cancelURL=%2F{! Account.Id}&RecordType="+qc_rec+"&ent=Contact";
}
else
{
returnUrl = "/003/e?retURL=%2F{! Account.Id }&cancelURL=%2F{! Account.Id}&RecordType="+qc_rec1+"&ent=Contact";
}
window.location.href = returnUrl;