function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BrianWKBrianWK 

Validation Rule: "Filter" valid Lookup options from Account Lookup

Hey everybody.
 
We have a custom lookup field on our Account page that is a lookup to other Accounts. At this time, any Account could be selected and saved successfully.
 
I'm looking for a way to only allow Accounts with type "GPO" to save successfully in this lookup field. I was hoping I could do this using a validation rule, but I'm having difficult trying to find what the "Type" field is on the Lookup Account.
 
Does anyone have any suggestions or could point me in the right direction. I thought since it was a lookup field I could use the new Cross-object validation options, but that does not appear to be available for our Account Lookup field.
 
Thanks
will smith Linwill smith Lin
I also want to filter the result by account type  when search from  Account lookup . Dose anyone know how to do it ?
BrianWKBrianWK
I don't necessarily need the list to be filtered. I do need the lookup field to only saved when a valid account is in the lookup field
BrianWKBrianWK
I could still use some assistance.
 
Could I use vlookup? I was thinking I could have a validation rule that used vlookup to pull the Account.Type field from the related Account (Lookup field called GPO). I tried but could not get vlookup to pass the syntax check.

Again, I really just need to verify that the account in the lookup field (Gpo) has "GPO" in the 'Type' field of the Account
GanuGanu

Hi,

Try this by "Enhanced Lookups" in setup -- customize -- search, and check it for account.

And choose the field: By  Account -- search layout -- edit "look up filter field",.

 

Thanks,

Ganesh

BrianWKBrianWK
Ganu,
 
Thanks for the reply and suggestion. My understanding is the Enhanced Lookup option is a global setting and can not be set to a single lookup field.
 
We use the Account object in many field lookups and do not want to restrict those. We do want to restrict 1 field residing on the Account page that looksup to other Accounts. It doesn't have to filter that list, but I would love to prevent a non-valid Account from being selected in this 1 Account Lookup field.