is it possible to have a custom button for "log a call" with preselection of the record type instead of having the user to select a record type?

the url for the standard button looks like this


Thanks a lot in advance for your help

2 Answers 2


You can do this using Salesforce Ajax Toolkit with a custom button. You have to fetch the required RecordType and associate it with the new Record. The JavaScript code will somehow look like this. (Please note this code is for example only and is not a compiled one)


var custObj = new sforce.SObject("MyObject__c");
custObj.id = "{!MyObject__c.Id}";
var qr = sforce.connection.query("SELECT Id FROM RecordType WHERE SobjectType ='" + "MyObject__c" + "'" + " AND DeveloperName = '" + "RecordType_Name" + "'"); //Change the RecordType Name 
custObj.RecordTypeId = qr.records.Id;
window.location.href = URL; //Create your own URL here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .