+ Start a Discussion

accessablity in visualforce

Hi Guys,


I'm using following code for rendering an account record and its contacts. My user from a profile doesnt have read access to contact object. So to avoid error message I've used "$ObjectType.Contact.accessible". But it doesn't seem working for me.

Can you tell what I am missing here?


<apex:page standardController="account" tabstyle="Attendance__c">
<apex:pageBlock title="My Content">

    <apex:pageBlockTable value="{!account.Contacts}" var="item" rendered="{!$ObjectType.contact.accessible}">
        <apex:column value="{!item.name}"/> 


<apex:detail rendered="{!$ObjectType.account.accessible}"/>




Please follow the link :




This is just for reference :


<apex:outputText value="{!Contact.Name}" 
             rendered="{!$ObjectType.Contact.fields.Name.Accessible}" />



You cannot render an account record and its contacts until you assign the “read access” permission (for the profile) to the Contact Object .


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.