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
Jessica LandismanJessica Landisman 

Can I display <apex:detail subject="{!account.Id}" relatedList="true"/> in read-only mode?

<apex:detail subject="{!account.Id}" relatedList="true"/> includes edit and delete buttons, but there are times (based on the Shared Groups configuration) that I'd like to display all the details of an Account but only allow the user to read (but not modify) the data.

 

I have used a field set and a VF page to show a limited view of an account, but I'd rather not create field sets for every section of the account page when the one line of code mentioned above already encapsulates all those fields and displays them so easily.

 

Are there ways to lock down <apex:detail subject="{!account.Id}" relatedList="true"/> to read-only mode?

 

Thanks,

Best Answer chosen by Admin (Salesforce Developers) 
Shashikant SharmaShashikant Sharma

I am afraid you can not do this , only way is a use out put field , you can use field set for ease as you were doing earleir. You can not remove any button from a detail view.