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
CRMUser23CRMUser23 

Filter Contacts in lookup

I created a custom lookup on Contacts table, I need to see only contacts that belong to "x" contact r\ole when I hit the search/lookup.  Is it possible to filter contacts as per my requirement?
Also I need to lock the Custom Lookup field once the contact is`selected...  Please advice
sfdcfoxsfdcfox
No, and Yes... to an extent.

You can't filter lookup dialogs with the current release, but know that you're not alone...

In the current release, you can either write a validation rule to enforce that the lookup field is read-only once a value is in place (And(Not(PriorValue(Contact__c)=""),IsChanged(Contact__c))), or you can use record types (if you're in a profile-enabled organization) to lock the field to all but admins after the initial edit (or Apex Triggers, but that's a bit overkill).

~ sfdcfox ~
CRMUser23CRMUser23

Thankyou.