I have a master object and a child object (which shares a M/D relationship). The child object is nothing but a bunch of transaction records. I have an approval process defined on the master object and approval history related list is added to the page layout.
Now, I have a 'submit for approval" button on the master record.
- When this get clicked, the approval history related list has a new entry for "Reassign/Approval/reject" and
- When I click this, it takes me to an approval/reject/cancel page where I hit approve and the "trigger" on the master object runs in the same execution context when the record is being approved.
- However, if the trigger throws an error, I'm unable to capture that and show on the master record page itself since I clicked the "approve button" on a different page and the error message shows up on a new page.
Question: Is there anyway for me to capture that and show it on the "master record" page itself.