Posts

Showing posts with the label Approval Request

Salesforce Fact #571 | Approval request in chatter

How can we ensure the approver receives the approval request as a chatter post. Setup -> Chatter Settings -> Enable Allow Approvals. Reference:  https://help.salesforce.com/s/articleView?id=sf.approvals_for_chatter_enabling.htm&type=5

Salesforce Fact #5 | recall

Most of the times we approve or reject a record submitted for approval using apex. But we can also recall a record using apex as below: ProcessInstanceWorkItem pwr = [SELECT Id FROM ProcessInstanceWorkItem WHERE ProcessInstance.TargetObjectId=<recordId>]; Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest(); req.setWorkItemId(pwr.Id); req.setAction('Removed'); Approval.process(req);