Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to filter the available child record types a user can create based on the parent record type, any ideas?

share|improve this question
You may need a two fields like making dependent picklist and store record type there and this will allow you to achieve your functionality.Its just my thought .I wont be surprised if people come with better solution – Mohith Shrivastava Dec 6 '12 at 18:15
A simple validation rule on the child record should do it, though its more reactive than proactively filtering. – techtrekker Dec 6 '12 at 19:36
up vote 1 down vote accepted

One possible alternative is to override the new record creation of the child object with a Visualforce page, and use whatever logic you want to enforce the record type. I suppose the end user will be happy too.

Like the others mentioned a validation rule could work, but it may be a bit ugly from the end user perspective, since its not really the user's fault that he/she was allowed to choose that option.

share|improve this answer
This is what I ended up doing as well. Sorry I hadn't responded sooner. Thanks. – rcraven Feb 9 '14 at 0:38

As techtrekker mentioned, I'd suggest creating a validation rule. I'm not aware of a way to filter immediately and would be interested to know if there's a better solution.

As a quick test I created a validation rule on the child object, similar to the following:

Parent__r.RecordTypeId == '012E00000001lBA' && RecordTypeId != '012E00000001lB5'

In this example, if the child record type's Id is not equal to '012E00000001lB5' when the parent record type Id is '012E00000001lBA', the child record fails to save.

If you're going to be using this validation rule in multiple org's, a better way may be to create a formula field on both the parent and child objects that reference the record's RecordType.Name. Then you could adjust your validation rule to something like this:

Parent__r.RecordTypeName__c == 'Parent Record Type' && (RecordTypeName__c != 'Child Record Type Allowed A' || RecordTypeName__c != 'Child Record Type Allowed B')
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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