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