3

I need to customize one VF page for certain clients (Orgs) by enabling different views of that page for certain orgs (as per their requirements). I want to distribute the main package to the users who need the main functionality And if they wish to have the extended functionality by some customization on the VF pages that they have in the managed package.

Is it possible to override the existing VF page in the managed package by means of some extension package that is unmanaged?

Sunil Sharma

1
  • So as explained in above points -Suppose we create a VF page (default) for managed package and then after installation of package, organization will do customization for this page as they want. Oct 7, 2014 at 9:54

2 Answers 2

0

It depends on where the VF page is used. If it is used to override a standard action like New, Edit or Clone, the override could be changed to another VF page (unmanaged or managed) or even back to the standard system page.

If it is a page, which is called by a custom button, this wont be so easy.

4
  • Suppose client requires a customized view instead of default one (that is also a VF Page and part of the managed package), can we also add an unmanaged pkg that contains the advanced screens(VF Pages) and overrides the default one. Can we modify that VF screen to reorganize the layout, add custom fields, etc. ? Pls Suggest. Oct 7, 2014 at 10:05
  • The managed VF page can only be replaced not edited. Of course the replacement page can have its own layout. Oct 7, 2014 at 10:10
  • Now I have a follow up question to my original question. We have a visualforce page in our managed package that users want to customize to add their own custom fields as well as add some logic to the page that pre-populates some of the fields when it is loaded based on some business logic with some UI enhancements using custom CSS. Is there a way to get this done using managed code? Oct 7, 2014 at 11:58
  • You should ask that in a new question. Oct 7, 2014 at 12:13
0

You may have multiple possible override candidates at the same time for standard pages like New, Edit, View provided by multiple Visualforce pages of different origin. They may come form an managed or unmanaged package or be created directly on the org itself.

Only one of them can be selected to be used in a given org at a time. This decision will be made by the admin.

Not sure if you are looking for some kind of dynamic extension mechanism - not a radical replacement. This is not supported directly by the platform, however even that could achieved by selectively including VF Pages inside pages using <apex:include> and a logic inside the controller to provide dynamic reference according to a dynamic detection of the presence of an additional packages.

Regarding to your followup question:

We have a visualforce page in our managed package that users want to customize to add their own custom fields as well as add some logic to the page that pre-populates some of the fields when it is loaded based on some business logic with some UI enhancements using custom CSS. Is there a way to get this done using managed code?

You can use <apex:detail> to include the standard page layout which still can be customized via the point-and-click features of the layout-editor in the setup.

Now using java-script you could prepopulate and modify that by your VF page, on which you embed the <apex:detail>. This is not best practice because your JS would relay on SF Markup which could be possibly changed in the future. And you will be have a challenge to figure out dynamically the Ids of the fields - but using the ToolingAPI and this approach, it should be possible: http://andyinthecloud.com/2014/01/05/querying-custom-object-and-field-ids-via-tooling-api/

You must log in to answer this question.

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