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
AdamSBealAdamSBeal 

Lookup filter issue in customer portal visualforce page

I have a contact field on a custom object I am exposing in a visualforce page in our customer portal. I would like it so that contacts related to the logged in portal user show only. Currently they can search all accounts which isn't cool. Any ideas on how to make this happen? 

 

Thanks!

 

Adam

Best Answer chosen by Admin (Salesforce Developers) 
Vinita_SFDCVinita_SFDC

Hello Adam,

 

At present lookup filters are not fully supported on Visual force pages. Please vote this idea for the same: https://success.salesforce.com/ideaView?id=08730000000KQJ0AAO

 

I would suggest you to accomplish this by making some changes in your sharing structure. Change the Org Wide Default (OWD)settings for the Contacts/Accounts (which ever is appearing on VF) to private and create a sharing rule for the customer portal user and share the respective accounts with them.

 

Hope this helps!

All Answers

Vinita_SFDCVinita_SFDC

Hello Adam,

 

At present lookup filters are not fully supported on Visual force pages. Please vote this idea for the same: https://success.salesforce.com/ideaView?id=08730000000KQJ0AAO

 

I would suggest you to accomplish this by making some changes in your sharing structure. Change the Org Wide Default (OWD)settings for the Contacts/Accounts (which ever is appearing on VF) to private and create a sharing rule for the customer portal user and share the respective accounts with them.

 

Hope this helps!

This was selected as the best answer
AdamSBealAdamSBeal
Hey Vinita thanks a lot for the reply. I did set contacts to private in the org wide sharing and that fixed the issue. It did break the code since I was creating and saving a contact and had my class set as "with sharing". I changed that to without and now all seems to be working good.