You need to sign in to do that
Don't have an account?
Cheryl Rivard
Create a custom button to open a related record
I need to create a button that is on the Account Page that opens a related (custom object) record where the Account ID is the same as the related record. There is only suppose to be one related record for each account. I'm stumped on how to do it. Thanks
All Answers
Please use below approach to create button and to call the apex code:http://blog.shivanathd.com/2014/07/call-apex-class-from-custom-button-salesforce.html
In Apex code , query your custom object wrt to the accountid and rediect user to the custom object record using pagereference.
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
Have you treid simply updating the page layout to include the related list for the custom object? This will save you from writing Apex code which will require unit test coverage, more maintenance expenses, etc.