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
GoForceGoGoForceGo 

Relationship - __r.Name not working: multi-step VF form

 

I have a Extension Controller pages where a user go through a 3 step form. On 4th step they  review and submit the form.

 

On page 1, I ask them to select a lookup field called department. I create a new record when they go to page 2. On Page 4 (review and submit), I show them the department using department__r.Name.

 

The department name shows up as empty on page 4. If I do an <outputField department__c/>, I can see the name, but I don't want to do this, since this page is exposed as a sites page as well and a clickable link would error out.

 

If I directly access page 4 at this point (by just typing in the page URL inthe browser), I CAN see the department name. So it doesn't appear to be a security setting issue. The issue happens whether I access the page using sites or as a logged in Admin user.

 

I tried adding department__r.Name as a rendered = "false" on page 1. But it did not work.

 

 

. What could it be?

 

 

 

Shailesh DeshpandeShailesh Deshpande
May not be the case, but still if you could verify whether the field and the object are made available for use in the site.
GoForceGoGoForceGo

I did verify the security settings.The issue is not security related due to following confirmations

 

1. The issue happens whether I am using Sites, an Admin user (with View/Modify all data)  or another user.

2. If I just access the Page 4 directly, I see the values

 

 

Shailesh DeshpandeShailesh Deshpande
Agreed. If you have a vf page and you are trying to display data from an object, it is required tbat you explicitly provide Read access to that object to be used in the site. What I meant was, to check whether the profile associated with the site has the field and object available or not. Please refer the below link:

http://wiki.developerforce.com/page/An_Introduction_to_Force.com_Sites
http://wiki.developerforce.com/page/Authenticating_Users_on_Force.com_Sites