0

Is it possible to pull the Status field of an approval process into a Visualforce page that is only using a standard controller for a custom object? I tried using {!Custom_Object__c.ProcessInstance.Status} but that does not work.

  • Can you try {!Custom_Object__r.ProcessInstance.Status}? The __r showing the traversal of the related object. – Andy Hitchings Jun 10 '16 at 16:11
  • Thanks Andy. Unfortunately, no. I get the error "Unknown property 'Custom_Object__cStandardController.Custom_Object__r' – J. Neilan Jun 10 '16 at 18:12
1

ProcessInstance staus can not be accessed directly from the object. You can query it in the constructor of the extension:

SELECT status FROM ProcessInstance WHERE TargetObjectId=:(Custom_Object__c)controller.getRecord().id;
  • Thanks. As I mentioned, I'm not using a custom controller though and was trying to avoid doing so. – J. Neilan Jun 10 '16 at 19:35

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.