buli
2023-05-23 07390e2fcb4adf27c928335bf27ae7939c5a80ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public with sharing class ApprovalResultController {
    //审批意见
    public String targetObjId{get;set;}
    public String comments{get{
        comments = '';
        ProcessInstance pi = [SELECT Id,
                                        (SELECT StepStatus, Comments,ActorId FROM Steps order by createddate desc)
                                     FROM ProcessInstance
                                     WHERE targetObjectId = :targetObjId limit 1];
        if(pi <> null) {
            comments = pi.Steps[0].Comments;
        }
        return comments;
    }set;}
    @TestVisible
    public static void testI() {
        integer i = 0;
       
    }
}