You need to sign in to do that
Don't have an account?
davcondev
Render lookup inputField based on permissions?
Lookup inputFields do not display on Visualforce pages if the user doesn't have at least read access to the related object.
Is there a way to detect this (interrogate user permissions? check whether the field is displayed?) and rendering appropriately instead of just having a missing field?
i.e. If user has object rights, show an inputField, otherwise show explanatory outputText.
A VF only solution is preferred rather than javascript or controller side logic.
I believe you can test accessibility of a field via the $ObjectType global variable in a VF expression, though I'm not sure of the syntax and it is poorly documented. Something like {!$ObjectType.object.Fields.fieldname.isAccessible}
All Answers
I believe you can test accessibility of a field via the $ObjectType global variable in a VF expression, though I'm not sure of the syntax and it is poorly documented. Something like {!$ObjectType.object.Fields.fieldname.isAccessible}
It's easy when you know how huh?
For my outputText I just added
rendered="{!!$ObjectType.myCustomObject__c.accessible}"