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
B2AB2A 

Overriding View and Edit page

Hi, i'm new at Visualforce and I was wondering what I have to do to entirely replace an Accounts page layout with Visualforce designed Accounts layout page?

 

Do I have to create a page for the edit mode and override that (from buttons & links in setup) and do the same for the view mode page?

 

If I am wrong, what are the appropriate steps to take?

 

Thanks for any help for this newbie to VF!!

wesnoltewesnolte

Hey

 

There are many ways to implement it, but the way you've suggested is correct. You'd create a single page that would handle creating and editing accounts, and another for viewing accounts. You would then override the new and edit actions and point them to the first page and override teh view action and point it to the second page.

 

 Cheers,

Wes 

B2AB2A
Thanks for the guidance Wes!!  Is there  aseparate action for Create New than there is for Edit, or are they both considered edit?
momorganmomorgan

Again, you're on the right track.

 

As an example, go to Setup > App Setup > Customize > Accounts > Buttons and Links. There, you'll see that you can overwrite the standard New, Edit, View etc. functionality with VisualForce pages of your choosing.

 

So yes, you could have one VF page for New and another for Edit, if you so wished. I tend to find that a well-designed page can often do both, but that's for you to decide as you go.

 

Hope that helps :)

B2AB2A

Thanks, i just realized there was a "New" there, i guess I missed it the first time! (Need glasses!!)

 

 

B2AB2A
Is there an alternative way to post VF pages to replace page layouts ?
wesnoltewesnolte

Hey

 

You could create a tab based on a visualforce page and code all of the functionality yourself. Then you control the entire edit, view, save process and don't have to override anything.

 

Cheers,

Wes