[SalesForce] Automate record type selection

We have a requirement where we have to automate record type selection of child objects based on the record type of master. For example there is an object X (master) with 3 record types (r1,r2 and r3). The child object(Y) has similar record types i.e r1, r2 and r3. Now if an user creates a record in X of recordtype r1 and goes on to create a record on Y using the new button on the related list then the record selection page shouldn't be displayed and the user will be taken straight into the specific page for the particular record type i.e r1.

How can we achieve this?

Best Answer

You can achieve this by creating three custom list buttons on the child object, one for each record type.

The content type of the button should be URL and the URL should look something like this.

/xxx/e?CF00ND000000xxxx={!X.Name}&CF00ND000000xxxx_lkid={!X.Id}&retURL=%2F{!Account.Id}&RecordTypeId='ChildRecordTypeId_R1'

Change the 'xxx' to key prefix of your custom object x and field Id 'CF00ND000000xxxx' field id of the lookup field x on your child object.

Create different page layouts for each recordtype in X. Expose the each of list of the child list button in each layout.

Hope this is helpful.

Related Topic