Loading

Editing Visualforce Pages from a Managed Package in a Salesforce Subscriber Org

게시 일자: May 19, 2026
상세 설명

In Salesforce, Visualforce pages that are part of a Managed Package cannot be directly modified in a Subscriber Org. This is a platform restriction that protects the integrity of managed package components. This article explains two available approaches for working around this limitation: using Field Sets for dynamic field display, and creating a custom override of the managed package Visualforce page.

솔루션

Option 1: Use Field Sets for Dynamic Display

The cleanest solution is to generate the fields displayed in the Visualforce page dynamically, using Field Sets defined on the object. This approach avoids hardcoding field names and allows the Subscriber Org admin to control which fields are displayed without modifying the managed package page itself.
To implement this:

  1. Create a Field Set on the relevant object in your org (for example, a Field Set named accountFieldSet on the Account object).
  2. In your custom Visualforce page, use an apex:repeat component that iterates over the Field Set and renders an apex:InputField for each field.
  3. The apex:repeat references $ObjectType.Account.fieldsets.accountFieldSet as its value, and uses {!Account[fieldValue]} to bind the field to the input.
  4. You can create multiple Field Sets for different sections of the page if needed.

 This approach allows fields to be added or removed from the Field Set without modifying the Visualforce page markup.

<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]}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>

 

Option 2: Override the Managed Package Visualforce Page

If the managed package's controller is defined as global, and all its public properties and methods are defined as global, a developer in the Subscriber Org can copy the managed package Visualforce page markup, create a new custom Visualforce page in their org, and reference the managed package controller and its properties and methods — including the namespace prefix.
To override the managed package Visualforce page using global virtual controllers:

  • The controller must be defined as global virtual.
  • All public methods that you want to override must be defined as global virtual.
  • The developer in the local org can then extend the managed package class and override specific methods as needed.
Knowledge 기사 번호

000386272

 
로드 중
Salesforce Help | Article