+ Start a Discussion
Wil PhoWil Pho 

lookup filter formula not displaying the correct contact

Hi there,

I trying to write a formula in a lookup filter so that when a user enters a contact’s name, it will only display contacts that are associated with the same parent account. The lookup filter is in a Flow.
User-added image
Here’s is the formula:


Id Not In ({!PreviousStudentIds}) AND IsPersonAccount = TRUE AND NU__IsMemberFlag__c = false AND NU__PrimaryAffiliation__c = '{!TroupAffiliationId}'

We use Person Accounts data model and a custom object called Affiliation. The Accounts objects has a self-lookup relationship.

User-added image
The Affiliation object has a lookup (NU_ParentAccount__c) to the Account.

User-added imageTroupAffiliationId is a variable in the Flow that stores the parent account.
User-added image
The filter formula is still displaying contacts that are NOT associated with the same parent account.

Any suggestion as to how to fix the formula?

Thanks,
Wil
PriyaPriya (Salesforce Developers) 

Hi Will,

Please refer this example for logic :- 

https://salesforce.stackexchange.com/questions/70887/lookup-filter-to-display-contacts-related-to-selected-account

This may help you. 

Regards,

Priya Ranjan

Wil PhoWil Pho
Thanks, Priya. I'll look into it.