Query in Custom Button in Salesforce

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}


var recordtypeResultIDD = sforce.connection.query("Select Id FROM RecordType WHERE Name='Visit Contact' and SobjectType='Contact_Role__c'");

records = recordtypeResultIDD.getArray("records");

window.location="/a0B/e?CF00N9E000000KULE={!Visit__c.Name}&RecordType_ileinner="+records[0].Id+"&RecordType="+records[0].Id+"&retURL={!Visit__c.Id}";


0 comments:

Post a Comment