[SalesForce] Approval History (sObject ‘ProcessInstance’) – Overall Status field, queryable

  1. Is it possible to declaratively capture the current 'Overall Status'
    from the Approval History object on the related master record? I
    assume that this is not possible.
  2. Is it possible to SOQL on the the 'Overall Status' field from the
    Approval History? I am not able to find this field via the API
    (workbench). Looking at the documentation, there is no field
    for 'Overall Status'.
  3. If it is not possible to SOQL on the 'Overall Status' field, is the
    best approach to use a custom Visualforce page to override the
    standard page and use JavaScript to capture the first index in the
    'Overall Status' column? This answer looks like it would point
    me in the right direction. Or would another approach be to query all the ProcessInstanceSteps that belong to a single ProcessInstance record and query the StepStatus?

enter image description here

Best Answer

It's just the Status field. You can also get the individual step statuses from ProcessInstanceStep.

SELECT Status, TargetObjectId, (Select StepStatus FROM Steps)
FROM ProcessInstance WHERE TargetObjectId = '<id_here>'
Related Topic