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
Francisco Riccomagno 1Francisco Riccomagno 1 

Public VisualForce page not showing Lookup result

Hello, I've created a VisualForce page and made it public. The page is to enter the Custom Object fields. One of them is a Lookup to another Custom Object. The problem is that for some reason when I click in the Lookup icon is not showing any information, and only showing:
•There are no records of this type
•You don't have permission to see any of the records
•Records do not fit the filter criteria set by your administrator
•One or more controlling fields are blank or invalid (Controlling fields: myCustomObject)

The thing is that when I'm logged in as an admin, the Lookup works perfectly.
I set up the Object Permissions under both custom objects, but still having the same result.
Any thoughts?
Best Answer chosen by Francisco Riccomagno 1
Daniel B ProbertDaniel B Probert
have you set the site permissions to allow read access to the objects?

All Answers

Daniel B ProbertDaniel B Probert
have you set the site permissions to allow read access to the objects?
This was selected as the best answer
Francisco Riccomagno 1Francisco Riccomagno 1
Yes, I did, but it seems that when I'm using it logged in, the Lookup is auto populated, but when using in the public page is not, so I have to search for them.
Daniel B ProbertDaniel B Probert
i'm going to guess then that the vf page has an apex controller/extension that is pre-populating that lookup?

any chance you can share the page/controller so i can see what's going on?
Francisco Riccomagno 1Francisco Riccomagno 1
Yes, I have a custom controller, but it's not pre-populated. That's something I'm still researching as i would like to be able to "help" the user showing the results instead of him/her remembering what to look for.
Daniel B ProbertDaniel B Probert
ok so what about javascript on the page or an id in the url - a lookup field only prepopulate if it's told to via url hacking or a javscript or controller :)

Francisco Riccomagno 1Francisco Riccomagno 1
How can I do it through controller? Can I assign a list of custom objects to the lookup field through SOQL?
Daniel B ProbertDaniel B Probert
yes take a look at this example:

http://www.infallibletechie.com/2012/10/dynamically-getting-picklist-values.html