function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
srikanth11srikanth11 

how to get query results into a array

i have written two queries now i want to bring all the queries into a lst array plz help how to do that

 

 workItemListstep = [Select  p.ProcessInstance.TargetObjectId,p.ProcessInstanceId,p.OriginalActorId,p.Id,p.ActorId,p.Actor.name From ProcessInstancestep p where p.ProcessInstance.TargetObjectId = :ID ];         
     workItemListitem = [Select  p.ProcessInstance.TargetObjectId,p.ProcessInstanceId,p.OriginalActorId,p.Id,p.ActorId,p.Actor.name From ProcessInstanceworkitem p where p.ProcessInstance.TargetObjectId = :ID ]; 

srikanth11srikanth11

i want to get the id's from the two queries into a list how can i do that plz help me in this

 

kiranmutturukiranmutturu

list<string> lstids = new list<string>();

for(ProcessInstancestep  obj : workItemListstep){

lstids.(obj.id);

}

 

for(ProcessInstanceworkitem obj : workItemListstep){

lstids.(obj.id);

}

here is the list of ids of the both the object...lstids


srikanth11srikanth11

hi kiran mutthuru now we have two variables with id's of two objects now can i bring these both combined into one variable plz help