I've created a button in my package to pass data to a new page. When I upload the package and install it on another org, the url doesn't work because the server, page name and field id's are different. How can I create a url that is more 'universal' and will accommodate other org installations? Here's the url.


1 Answer 1


By reading the package url it looks like that you want to pre-populate some values in specific fields of an object.

Unfortunately complete URL can not be made universal because here field ID is needed. Field ID can only be fetched either by Metadata or Tooling API and it will require api call-outs.

Workaround: Create a custom visualforce using that sObject as standard controller and pre-populate those fields through controller/extension code. Provide the page's relative URL (apex/MyPAckagePage) behind the custom button.

Object pre-fix can be found using SObject describe call. Custom Object also have different Ids when created in different environment.


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