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
Force.com  Developer.ax1566Force.com Developer.ax1566 

User object details not displayed on force.com site

Hi All,

 

I have a force.com site and I am trying to display a search criteria on the site.

 

Basically, The query does return the results, but I am unable to view it on the site. I am able to display all the custom object details correctly, but I am unable to display any details pertaining to a USER.

 

Senario,

I have logged in as a registered user to my site. I have created a new profile and given all the required permissions to the custom object , so that the fields are visible when i search on particular senario.

 

My search query is as below:

 

 public pagereference Search() {
        userVehicleDtlsLst = new List<Vehicle_Details__c>();
        userVehicleDtlsLst = [Select
                            v.User_Name__r.Phone, v.User_Name__r.Email, v.User_Name__r.FirstName,
                            v.User_Name__r.LastName, v.User_Name__r.Username,  v.Seats_Available__c,

                            From Vehicle_Details__c v
                            where v.Origination__c =: Origination and v.Destination__c =: Destination];
        system.debug('++++++UserValue'+userVehicleDtlsLst);                    
        return null;    
    }

 

VF page:

<apex:pageBlock id="pageBlk">
    <apex:pageBlockSection >
        <apex:pageBlockTable value="{!userVehicleDtlsLst}" var="userDetails" rendered="{!NOT(ISNULL(userVehicleDtlsLst))}" columns="7">
        <apex:column value="{!userDetails.User_Name__r}"/>
        <apex:column value="{!userDetails.User_Name__r.Email}"/>
        <apex:column value="{!userDetails.User_Name__r.Phone}"/>
        <apex:column value="{!userDetails.Seats_Available__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
    </apex:pageBlock>

 

Please let me know how i can display the User object details. All the code has been complied successfully.

 

Thanks