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
Oliver Freeman 9Oliver Freeman 9 

Custom New Button and RecordType Selection

Hello,

We have a custom object which is child to the Case object.
We use a custom New button so that we can set retURLs - the custom object in question has two RecordTypes - after passing the RecordType in the URL for the button, the cancelURL parameter does not pass through - I've tried this URL, but like I say, the cancelURL parameter does not work:

/a0F/e?CF00ND0000005CtcY={!Case.CaseNumber}&CF00ND0000005CtcY_lkid={!Case.Id}&saveURL=%2F{!Case.Id}&retURL=%2F{!Case.Id}&cancelURL=%2F{!Case.Id}&RecordType=012D0000000VCCR


Any help would be massively appreciated!

Thanks
NagendraNagendra (Salesforce Developers) 
hi Freeman,

Your action method for New should create a page reference to the record type selection page which you can find out by creating a new record. This will be the standard record type selection page. Also, your retUrl should be set to the custom visual force page so that the user is taken to the VF page once he selects the record type.

Please let us know if any further information is required.

Thanks,
Nagendra