function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ben Jones, CollabraxBen Jones, Collabrax 

Custom Button with Record Type

I have a customer button that creates a Opportunity record.  However I need it to also prefill the Record Type.

 

/006/e?retURL=/{!MyGovWatch__c.Id}&
opp3={!MyGovWatch__c.Buyer_Contract_Name__c}&
opp4={!MyGovWatch__c.Friendly_Name__c}&
CF00NE0000000KKWk={!MyGovWatch__c.Name}&
00NE0000000KP9r={!MyGovWatch__c.Forward_Flow_Dollars__c}

 

I tried adding...

 

&RecordTypeID="the name"

 

...but it didn't work.  How can I define the record type.  Right now it is making the record type the default.

Alex.AcostaAlex.Acosta

Easiest way to find the RecordType Id is to create a new Opportunity select your recordtype, and when it takes you to your pagelayout lookat your url. Copy your recordType Id and use it on your custom button. RecordTypeId has to be the salesforce Id of that record type, not the name of your record type.

Ben Jones, CollabraxBen Jones, Collabrax

I tried...

 

/006/e?retURL=/{!MyGovWatch__c.Id}&
opp3={!MyGovWatch__c.Buyer_Contract_Name__c}&
opp4={!MyGovWatch__c.Friendly_Name__c}&
CF00NE0000000KKWk={!MyGovWatch__c.Name}&
00NE0000000KP9r={!MyGovWatch__c.Forward_Flow_Dollars__c}

 

I tried adding...

 

&RecordTypeID="012E00000000H88"

 

...and it still defaulted to the default Record Type for Opportunities.  Any other ideas?

Alex.AcostaAlex.Acosta

no quotes

Ben Jones, CollabraxBen Jones, Collabrax

It is still defaulting to the default Record Type.  What other ideas to you have?

Alex.AcostaAlex.Acosta

The url should be RecordType not RecordTypeId, just noticed that. You may want to take a look at your 5th line on your example here as it seems you are missing letters CF from your input name field

 

This is a working example from my current companies org I've written.

 

/a07/e?

RecordType=012600000005E9y&

CF00N60000001otaY={!Project__c.Name}&

CF00N60000001otaY_lkid={!Project__c.Id}&

CF00N60000002NSg6={!Project__c.Project_Manager__c}&

CF00N60000002NSg6_lkid={!Project__c.Project_ManagerId__c}

Ben Jones, CollabraxBen Jones, Collabrax

Perfect!  Thanks so much!  RecordType=001C000000ofDyR did it.