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
akcooper9akcooper9 

VF Default View as Read NOT Edit

We've created a VF page that allows users to view our Accounts data in a custom view. The only isse we are running into is the default view when a user clicks on a record.

 

For example, when a user has read only access, they view the fields with out boxes around them. If the user has access to edit some fields, the fields display with boxes around them (editable). As an admin, I'm able to edit all fields thus I see every field on the VF pages with boxes around them.

 

How do we set the VF page to render/display in read mode and then if the records/fields need to be edited, they can be double clicked etc?

 

Hope this makes sense. Let me know if you'd like to see the code.

 

Thanks

 

Aaron

Best Answer chosen by Admin (Salesforce Developers) 
aballardaballard

Basically, you have to use apex:outputField instead of apex:inputField and the apex:inlineEditSupport component to allow the "click-to-edit" functionality. 

 

See this topic in the documentation:

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_quick_start_inline_editing.htm#kanchor123

All Answers

aballardaballard

Basically, you have to use apex:outputField instead of apex:inputField and the apex:inlineEditSupport component to allow the "click-to-edit" functionality. 

 

See this topic in the documentation:

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_quick_start_inline_editing.htm#kanchor123

This was selected as the best answer
akcooper9akcooper9

Aww I see the difference now! Thank you for the quick respone and guiding me in the right direction.