1

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

https://eu4.salesforce.com/setup/ui/recordtypeselect.jsp?ent=Task&retURL=%2F00157000020NCcs&save_new_url=%2F00T%2Fe%3Ftitle%3DAnruf%26who_id%3D00157000020NCcs%26what_id%3D00157000020NCcs%26followup%3D1%26tsk5%3DAnruf%26retURL%3D%252F00157000020NCcs

Thanks a lot in advance for your help

0

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)

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.