Activity Forums Salesforce® Discussions How to detect if a user has write permissions for a field on a Salesforce visualforce page?

  • Mohit

    Member
    September 23, 2016 at 5:56 am

    Hi Tanu,

    You cam detect the writing permission for a field on the visualforce page by two ways:-

    1)Visualforce Component:-By using the apex:inputField and apex:outputField components to accept and display data to the user, the platform will automatically respect the current users Field Level Security. Hiding the field if it is not visible to them or making it read only if they cannot edit it.

    2)Visualforce $ObjectType:- We can also access this information using the $ObjectType global variable

    Eg-apex:outputText value="{!contactName}" rendered="{!$ObjectType.Contact.fields.Name.Accessible}"

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos