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
Siana DcruzSiana Dcruz 

How to filter lookups based on the logged in user?

Hey all..

I have created a portal and the users will be accessing it through the custom tab in the platform.Everything works fine but i have a lookup field which has a lookup to contacts.The contact records which a user doesn't have access to can also be seen in the lookup.Can anyone please help me to filter these lookups so that the user can see only those contacts which he has access to.
Thanks!!
SandhyaSandhya (Salesforce Developers) 
Hi Siana Dcruz,

The lookup filters you create in Salesforce also appear in the partner portal and Customer Portal.Statement from below link.

https://help.salesforce.com/apex/HTViewHelpDoc?id=fields_lookup_filters_notes.htm&language=en

 Please refer below link for filtering the lookups based on profiles.

https://help.salesforce.com/apex/HTViewHelpDoc?id=fields_lookup_filters_examples.htm
 
If your organization has enabled a community and has portal licenses provisioned for it, User Sharing is enabled automatically. When User Sharing is on, you can choose which other users community users can see by default. If your organization has Customer or Partner Portals, you can choose a default for them as well. Users who can see one another can interact with all the communities or portals in your organization. For example, if you would like to have a more private community, you can deselect the Community User Visibility checkbox and use other sharing features like sharing rules, manual shares, or portal access.

Please refer below link for the same.

https://help.salesforce.com/apex/HTViewHelpDoc?id=security_sharing_owd_external_user_settings.htm&language=en_US
 
Hope this helps you!

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
 
Thanks and Regards
Sandhya