1

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.

  1. When this get clicked, the approval history related list has a new entry for "Reassign/Approval/reject" and
  2. 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.
  3. 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.

1

This is by design.

Any approval process related error will show in separate page.

(https://salesforce url/_ui/knowledge/services/core/workflow/SubmitWithParameters.....)

If you want to show in the Master record page, you need to develop visualforce page for Master Object and capture and throw approval process related errors in same page.

  • Thank you for your inputs. It's not really an approval process related error. The error is due to the trigger that's running (which gets triggered) due to the approval process. Just wanted to make sure I'm asking it correctly. – JJSHHS Jan 13 '17 at 17:15
  • can you post some pictures here how you are getting the error on screen – Santanu Boral Jan 13 '17 at 18:03
  • @JJSHHS - I think you are out of luck here, the approve/reject page is the one that launches the transaction and as such, will receive the error message – cropredy Jan 14 '17 at 0:21
  • That's better :) – Santanu Boral Jan 15 '17 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.