+ Start a Discussion
MiddhaMiddha 

Querying Ideas within Force.com Sites

Hi,

I am trying to display idea records on a public page. For this, I created a controller where i query the idea object and list all the records on a visualforce page.

This works fine , when i open this visualforce page within salesforce. But making this page public, and viewing this page , it doesnt shows any results. The query returns 0 records, even if it has number of ideas available.

I gave "readonly" permission to ideas object for guest user profile. Am i missing something OR sites does not allow to query ideas from a guest user context. If they dont, what is the purpose of giving read only permission on guest user profile?

Any help is appreciated,

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent
You need to do the following:
1- Create a customer portal or PRM portal (this is enabled in the new Developer orgs)
2- Enable your idea community for that portal
3- Enable login for your site (site details > login settings > edit > select your active portal)
4- Assign the ideashome visualforce page as your site active home page (this is one of the sample pages created when you create your site)
5- Make sure your site has read access on the ideas object (site details > public access settings > edit > check read on ideas object, by default this should be checked)

These steps will let you to see the ideas via your site. However, in order to post an idea, comment on an idea, vote for an idea you need to be an authenticated user (so that system would avoid users voting for their own ideas)

The last step to complete the loop is the user registration piece. We provide out of the box sample visualforce pages and apex controllers for login, registration, reset password and change password.
For ideas registration use case, you need to update the SiteRegisterController and populate the account id with an account in your own org.

Ideas help has more information on this topic.

All Answers

Ron HessRon Hess
The controller you created must be listed in the list of classes that the public user is allowed to execute.

If you created this controller after creating the site, it may not be automatically added to that profile list.
MiddhaMiddha
Hi Ron,

I did added the class and page to sites public user, but still it was not working. When i created a site, i did not associated it to a portal so the query was not returning any results.

When i related my site to a customer portal, i am getting the records on the page.

Thanks.
BulentBulent
You need to do the following:
1- Create a customer portal or PRM portal (this is enabled in the new Developer orgs)
2- Enable your idea community for that portal
3- Enable login for your site (site details > login settings > edit > select your active portal)
4- Assign the ideashome visualforce page as your site active home page (this is one of the sample pages created when you create your site)
5- Make sure your site has read access on the ideas object (site details > public access settings > edit > check read on ideas object, by default this should be checked)

These steps will let you to see the ideas via your site. However, in order to post an idea, comment on an idea, vote for an idea you need to be an authenticated user (so that system would avoid users voting for their own ideas)

The last step to complete the loop is the user registration piece. We provide out of the box sample visualforce pages and apex controllers for login, registration, reset password and change password.
For ideas registration use case, you need to update the SiteRegisterController and populate the account id with an account in your own org.

Ideas help has more information on this topic.
This was selected as the best answer
tobibeertobibeer

Hi everyone,

 

Is this answer still valid? When I look at Ideas @ Starbucks I see a whole lot of information without ever having to log in. So, does read access (still) require any kind of portal? I don't want or need customers to login, I just want to display some query results for ideas.

 

Tobias.