0

How to refer to Visualforce page in homepage component to work in managed package?

 <iframe width="100%" height="500" src="/apex/vf_page" frameborder="0"> </iframe>

1 Answer 1

1

When the managed package is created a namespace prefix is nominated. Mostly the code that goes into the managed package does not have to change to have that prefix added because the platform takes care of the namespace prefixing automatically. But this is a case where you will need to add it.

So if your managed package namespace is "xxx":

<iframe width="100%" height="500" src="/apex/xxx__vf_page" frameborder="0"> </iframe>

This will also still work in your packaging org because page names with or without the namespace prefix are supported there.

5
  • Are there any technique to add this namespace dynamically. What if the metadata is deployed to different orgs with different namespaces?
    – Natallia
    Jun 16, 2014 at 14:46
  • @Natallia If the Visualforce page is in a managed package then its namespace prefix is fixed so I don't understand the need for it to be dynamic...
    – Keith C
    Jun 16, 2014 at 14:54
  • I agree with you but there is requirement to support like prod namespace and QA namespace.
    – Natallia
    Jun 16, 2014 at 15:05
  • @Natallia The namespace of a managed package stays the same whatever org it is deployed in; the host name varies (the part that goes before the /apex/...).
    – Keith C
    Jun 16, 2014 at 15:14
  • I know this but the project should support 2 host names(2 namespace prefixes)...Anyway thanks for your attention!
    – Natallia
    Jun 16, 2014 at 18:43

You must log in to answer this question.

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