You need to sign in to do that
Don't have an account?
unable to query steps of Process Instance in before/after update trigger
Trying to query the ActorId from Steps, but getting null
Trigger getApprover on customObj__c(before Update){
List<customObj__c> test=Trigger.new;
processInstances = [select (select ActorId,OriginalActorId from Steps order by CreatedDate desc)
from ProcessInstance where TargetObjectId =: test[0].Id];
Id Qid = processInstances[0].Steps[0].OriginalActorId;
test2=[Select Queue.Name from QueueSobject where QueueId =: Qid];
}
Qid is null, when I am trying to submit a record for approval,
throughing an error: List has no rows for assignment to Sobject.
Why is that subquery results are blank.
Any help would be appreciated to fetch the ActorId for that Process Instance.
Thanks,
Vishala