+ Start a Discussion
Eric Anderson 54Eric Anderson 54 

Launch a related list using a visualforce button

Hi there everyone,

We have a parent custom object related to a Child object. The default behavior on 'Save' or 'Cancel' out of Child entry object, doesn't take us to the parent object by default the way we think it should. So, we added a 'SaveURL' and 'CancelURL' values to take us back to the parent object. It is our understanding from 'Support' that this is concidered a 'URL Hack'. Their recommended solution is that we "... impliment a VisualForce button instead of a 'URL Hack' on a link button so that substitutional parameters can be passed correctly." We asked them for an example and they so far have not been able to provide us with an example. We aren't quite sure what we should do with a 'VisualForce' button. The natural 'Extension' of our logic based on this comment from support is that we should then process the 'Child object' using a 'VisualForce' page instead of the default Child object that is presented by default by the Salesforce UI. 

The challenge that caused us to contact Support originally was the fact that the object ID's change when you move an APP from Development to Testing and then to production. We had a typo in our 'URL Hack' that was causing it not to work. We eventually figured out the problem with our 'URL Hack', but we are trying to pursue 'Best Practices'. We don't want to use 'URL Hacks' if they are not going to be supported (and maybe removed completely from the product). However, we can't afford the resources to put a lot of extra effort into developing VisualForce and Apex code to get around an issue that frankly we feel is a short coming in the software. (We think 'Cancel' or 'Save' should take you back to the parent object by default).

We would appreciate any meaningful input anyone can provide to get to this best practice.

Thanks!

- Eric -  
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Eric,

May I suggest you please refer the below link for reference. hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar