You need to sign in to do that
Don't have an account?
JJmemphis
How to restrict search results on related objects
I am trying to restrict search results on related objects. Is there a way to do that?
What I have is basically as follows:
I have on a clients profile two fields which relate to eachother in lookups.
States and Vendors.
The layout is like this:
Joe Farm Fresh Produce
FL (Look up, States Object)
Windixii (Look up, Vendors Object)
Now different states have different vendors. FL has Windixii and Walmart but not Costco. On each of the objects Windixii and Walmart Relates to FL and Vica Versa. Such as we have Windixii in FL, GA and CA.
I wanted to know if I have FL selected on the clients file, if there is a way to restrict the lookup on the "Vendors" field to only be those vendors that relate to that state. So if FL is selected only Windixii and Walmart would show when using the Vendors lookup. And if Windixii is selected, when doing the lookup in the "states" field only FL, GA and CA would show.
Any help you can provide on helping me limit these search results is greatly appreciated.
What I have is basically as follows:
I have on a clients profile two fields which relate to eachother in lookups.
States and Vendors.
The layout is like this:
Joe Farm Fresh Produce
FL (Look up, States Object)
Windixii (Look up, Vendors Object)
Now different states have different vendors. FL has Windixii and Walmart but not Costco. On each of the objects Windixii and Walmart Relates to FL and Vica Versa. Such as we have Windixii in FL, GA and CA.
I wanted to know if I have FL selected on the clients file, if there is a way to restrict the lookup on the "Vendors" field to only be those vendors that relate to that state. So if FL is selected only Windixii and Walmart would show when using the Vendors lookup. And if Windixii is selected, when doing the lookup in the "states" field only FL, GA and CA would show.
Any help you can provide on helping me limit these search results is greatly appreciated.
This is a problem of dynamic dependant picklists that needs some Apex code.
Static dependant picklists are standard in Salesforce with Controlling Field and Dependent Field.
Two techniques are well explained here; one of which uses <apex:actionSupport> to re-render the dynamic picklist filled with a SOQL query in the Apex controller: https://greatwavetech.com/visualforce-dependent-picklists/
Under Lightning, there are other examples.