如何获取salesforce的审批历史的各个字段内容
2023年09月02日
文章浏览:174

List<ProcessInstance> approvalInstances = [SELECT Id, Status

                                           FROM ProcessInstance

                                           WHERE TargetObjectId = :acc.Id];


List<ProcessInstanceStep> approvalSteps = [SELECT Id, Comments

                                           FROM ProcessInstanceStep

                                           WHERE ProcessInstanceId IN :approvalInstances

                                           ORDER BY CreatedDate DESC

                                           LIMIT 2];

for (ProcessInstanceStep step : approvalSteps) {

    System.debug('Comments: ' + step.Comments);

}

关注 收藏