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
HaroldHarold 

Disable and enable inline editing.

I have a visual force page with inline editing enabled.  It works great when a record exists, however I can't seem to get the page to not be inline editiable when no record exists.  I've tried changing the mode to just edit or detail when no record exists but it doesn't seem to be working. 

 

What I would like is when the page loads, if there is a record then inline editing should be enabled, if no record exists then it shouldn't.

 

I have a feeling that I'm going to have to disable each individual field when no record exists.

 

 

crop1645crop1645

Harold

 

Option 1

One solution for this is two pages - one that mimics New/Edit with entry (inputField) boxes and one that mimics View (outputField) (with inline edit). You override the New/Edit buttons to go to the first page, override the View button to go to the second page

 

Option 2

You could of course do this in one page with conditionally rendered page blocks.

 

I prefer the former option more helpful as you have more control over what you wan to expose for a new record use case versus a View record use case