2

Let's say I have three custom objects: Neighborhood, House, and Room. On the Account object, I have lookup fields for these objects.

My goal: When the user selects a Neighborhood, I want ONLY the houses contained within that neighborhood to be available for selection in the House field. After a house is selected, I want ONLY the rooms contained within that house to be available for selection in the Room field. Is there any way to do this?

I have already learned that there are ways to do this in a custom Lightning page. However, I'm looking for a way to do this with custom fields on a regular Salesforce object, like Account.

2

Disclaimer: I haven't tried it out myself, but going through the docs, it seems like you can utilize Dependent Lookups here.

A dependent lookup is a relationship field with a lookup filter that references fields on the source object. For example, you can configure the case Contact field to only show contacts associated with the account selected in the case Account Name field.

You will need to utilize Inserted Suggested Criteria when defining Lookup Filters to be able to utilize this.

When you define a lookup filter, optionally click Insert Suggested Criteria to choose from a list of lookup filter criteria that Salesforce suggests based on the relationships between objects in your org.

So in your case you will have a filter on your Household lookup to filter results based on the Neighborhood field and similarly a filter on your Room field to filter results based on the Household field.

2

Your House object should have a lookup to a Neighborhood. Your Room object should have a lookup to a House.

Then on the Account you can add filters to your House and Room lookup fields as follows:

House Lookup Filter that ensures that this house is in the same neighborhood that is specified on the account record House Lookup Filter that ensures that this house is in the same neighborhood that is specified on the account record

Room Lookup Filter that ensures this room is in the same house that is specified on the account Room Lookup Filter that ensures this room is in the same house that is specified on the account

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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