I am building a managed package that includes a VisualForce page that overrides the Account Edit page (by overriding the Edit button). Will users be able to customize this page? I worry that if they add fields to the Account layout, they will have no way to edit those fields, since my edit page overrides the one that would be generated based on the Account layout.

2 Answers 2


No, users can't modify managed code, including Visualforce pages. Instead, you should offer your functionality as a component, and an unmanaged page template for the administrators to modify at their leisure. The default template might look like this:

<apex:page standardController="Account" extensions="namespace.MyExtension">
   <!-- put your code here -->
   <namespace:myComponent accountId="{!Account.Id}" />
   <!-- you can put more code here -->

Alternatively, consider using the REST API to render the account layout directly from metadata, or use some template system where users specify the field order, etc.

  • How can I include an unmanaged page template in a managed package?
    – Neo
    May 14, 2015 at 17:03
  • Also, can you point me in the right direction regarding rendering the Account layout from metadata?
    – Neo
    May 14, 2015 at 21:50

No, they will not be able to edit the page.

The cleanest solution for this problem would be to generate the fields displayed dynamically based on field sets.

Here is an excellent article on using field sets to create VF dynamically. You would probably need to create multiple field sets for different sections of the page etc.

Here is a sample of what your code would look like:

    <apex:page standardController="Account">
  <apex:form >
      <apex:pageblock >    
          <apex:pageBlockSection title="Account detail">
             <apex:repeat value="{!$ObjectType.Account.fieldsets.accountFieldSet}" var="fieldValue">
                 <apex:Inputfield value="{!Account[fieldValue]}"/>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .