How to query Approval Comments in Salesforce?
Salesforce Approval Process Comments are stored in ProcessInstanceStep entity. Sample Query/SOQL: SELECT Id, Comments, StepStatus, Actor.Name FROM ProcessInstanceStep
Salesforce Approval Process Comments are stored in ProcessInstanceStep entity. Sample Query/SOQL: SELECT Id, Comments, StepStatus, Actor.Name FROM ProcessInstanceStep
1. Get the ProcessInstanceId. SELECT Id, ProcessInstanceId FROM ProcessInstanceStep WHERE Id = '<Id Of the Process Instance Step>’' 2. ProcessDefinitionId is the id of the Approval Process. SELECT Id, TargetObjectId, ....
Sample Apex Class: public class ApprovalProcessController { public static Approval.ProcessResult submitForApproval( Id recordId ) { Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest(); req1.setComments( 'Submitting request for approval' ); req1.setObjectId( recordId ); Approval.ProcessResult ....