0

I have a managed package that is deployed in an org. In the managed package there is a vf page called ShowInformation.vfp that shows some records.

Now, I have added new feature in ShowInformation.vfp page present in my dev org and added some links and buttons, some new vf pages with associated controllers. This ShowInformation.vfp page and other new vf pages needs to be sent as an extension.

Can the extension package replace already existing ShowInformation.vfp page present in an org?

If not, Is there any way by which i could replace already existing managed package vf page using extension vf page during the extension installation process.

Or, Can i just replace/add a particular section of managed package vf page with some additional links and button

1 Answer 1

0

As you control both packages, in the original package page you can provide the option of doing a server-side forward to the extension page:

<apex:page ... action="{!init}">
    ....
</apex:page>

with this controller method:

public PageReference init() {

    // Make choice via custom metadata or custom settings
    if (...) {
        // Continue into the body of the original package page
        return null;
    } else {
        // Use the extension package page instead specified
        // via custom metadata or custom settings
        String extensionPackagePageUrl = ...;
        return new PageReference(extensionPackagePageUrl);
    }
}
2
  • Isn't this would be same as redirecting a user to a different page.
    – Lambu
    May 16, 2018 at 8:52
  • @Lambu Yes it is: the URL will change to the extension package URL.
    – Keith C
    May 16, 2018 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.