I have a related list ( custom object ) on Opportunity record. When I click on New button of the custom object from the related list of the opportunity , I want to check the value of some field on the opportunity record based on which I should either redirect to another visualforce page else I should show some message. Can this be achieved using OnClick Javascript functionality on the Custom Button?
code snippet will be useful.
Thanks
Best Answer
This can be accomplished using a custom button that can be displayed on the related list. The JavaScript on that button will look similar to this:
You can also replace the
/apex/YourNextPageName
with aURLFOR
function.