• Flynn
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi, 

I am trying to build a trigger that runs directly after a Salesforce approval process is submitted.  Basically, I am trying to copy the approval information into a separate custom object that will create records that have both the approval information (Approver Name, Approval Status, etc.) and my custom object record information.  This will allow me to run more relevant reports off of the approval instances (than available through [out of the box reports](https://docs.releasenotes.salesforce.com/en-us/summer14/release-notes/rn_forcecom_process_approval_history_reports.htm)).  I also need the ability to generate a document with the approval information on it (who approved and when) and I can't find a solution for that without creating records in another object with the approval information copied into it.

I have attempted to run the trigger off of my custom object, but it seems impossible for the trigger to be able to run every time I need it to.  For instance, if there are multiple approvers in a step, there doesn't seem to be a way to update a field on the custom object record until the step is over.  

My question is if there is a way to run triggers off of ProcessInstance records (and subsequently ProcessInstanceStep and ProcessInstanceNode records).  I can't seem to create a trigger using the ProcessInstance object.

Thanks,Matt