When I develop a package and use a Visualforce page with additional parameters as custom button, URL button link doesn't work in subscriber org.
For example, my page has name MyBeautifulPage and URL button link
/apex/MyBeautifulPage?param=Value works great in Developer Edition org where package is developed, however, in subscriber org that button doesn't work.
Looks like it is need to determine the current URL and instance name to transform the URL correctly from
Looks like I can get
Organization by querying [select InstanceName from Organization], probably I could get current URL by
System.URL.getSalesforceBaseUrl().toExternalForm(), however it is not clear how to process it altogether correctly.