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
Matt ThomasMatt Thomas 

Dynamic Field Level Security

I have a visualforce page overriding the standard Account detail page. In that page, I'm using <apex:detail> to display the page layout. I'm currently faced with the challenge of situationally locking down the ability to edit the record type of the Account based on some kind of Product situation. Ideally, I'd like to be able to just show/hide the [Change] link next to the record type field on the page. Is this possible by using something like Account.fields.RecordType.isAccessible?

 

If not, is there any better way than creating a separate visualforce page and putting it on the page layout? Obviously, with a rendered="{!showChangeLink}" for the [Change] link after the outputField of RecordType.Name. This solution feels like too much for such a simple requirement. I'm also aware I could just inline it above or below the apex:detail tag, but that severely limits my location options.

 

I've also considered making it read only on the page layout indefinitely, and rendering a detail button on the page depending on whether or not it can be changed. Anyone's input on this would be greatly appreciated. Thanks for reading!

Vinita_SFDCVinita_SFDC

Hello,

 

I could not find anything like 'Account.fields.RecordType.isAccessible'. My suggestions is to create a validation rule like: if account is abc and product is xyz then record type should be null or something specific.