+ Start a Discussion

Picking Record Type in Detail Record Based on Information in Master

I'm sure there's a way I can do this, but I'm trying to figure out if there is a way to set the record type of a detail record based on some information in the master record when I create a detail record in a master-detail relationship.

I know that I can do it when the detail record is *saved* through a workflow rule -- but I'd really like to set the record type when I first hit "new" to create a new detail record on the master's page.

Any ideas?  Suggestions?  Best practices?

Chris ShadeChris Shade
Hi Michaell,

All the declaritive tools (non-coding tools) such as workflows, process builder, and flows are processed afer the record is saved.

Using an apex trigger you could likely code a solution that is executed before the save.

Some general info about how apex allows you to define before and after save actions: https://developer.salesforce.com/forums/?id=906F0000000AafFIAS

I think your other option would be a custom button, that would also involving coding but likely less.  You'd use that button to create the new detail records.