You need to sign in to do that
Don't have an account?
Raja Bipin Chandra M B
SOQL Relationship Quieries: how to fetch
Hello All,
I am joining objects to get the Approval comments, actor for the specific target object id. However, i need to know how to fetch the data from the result list of data.Please help!
Thanks,
Raja
I am joining objects to get the Approval comments, actor for the specific target object id. However, i need to know how to fetch the data from the result list of data.Please help!
processinstance = [SELECT Id,TargetObjectid, Status,(select id,actor.name from Workitems),(SELECT Id,StepStatus, Comments,Actor.Name,ActorId FROM Steps) FROM ProcessInstance where TargetObjectId=:setOfQuoteId]; for(ProcessInstance pi:processinstance){ ActorId.add(pi.ProcessInstanceStep.ActorId); // Error is here //ActorId.add(pi.ActorId); }
Thanks,
Raja
Try with below code ,Iterate with processInsatanceSteps .
Thanks
Manoj
All Answers
Try with below code ,Iterate with processInsatanceSteps .
Thanks
Manoj
You need to find the relation name
GoTo Steps object and search for MasterDetail(Lookup) and locate the ProcessInstance object and see what is the relationship name
Say the name is ProcessInstanceStep__c.
In your code you are required to use ProcessInstanceStep__r
And the code should look like
Donot forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
Above objects are not custom object .All are internal object repalted to Approval process . TargerObject is nothing but the sobject in which the approval proceess is ,Which ia always the parent obejct related to processInstance and processInstancestep is the child of ProcessInstance object and the relaionship name is Steps .Also two more object related to one is Processinstancehistory and ProcessInstanceWorkItem .
Any doubt please let me know .