You need to sign in to do that
Don't have an account?
Gary Singh (BlackBeltHelp)
unable to fetch value from function
I am new to APEX and attempting to fetch value returned from a fuction of the same class, the sample below gives me NULL and no errors.
Sounds silly, but I am unable to figure out I am doing wrong:
Sounds silly, but I am unable to figure out I am doing wrong:
public class ServiceCloudUtils { public static string getQueueId(string q){ LIST<group> queueInfo = [SELECT Id from group WHERE name = :q and TYPE='queue']; Set<id> Idset = new Set<id>(); string capturedId; for (group gvar: queueInfo){ capturedId = gvar.id; } system.debug('########### captured Queue Id : '+capturedId); return capturedId; } public static list<GroupMember> getQueueMembers(string queueToFetch){ list<string> queueMemberInfo = new list<string>(); // call above function to fetch queueId string tempQId = getQueueId(queueToFetch); system.debug('##### id collected in tempQId : '+tempQId); // SOQL to fetch queue members list<GroupMember> gMembers = [Select UserOrGroupId From GroupMember where GroupId =:tempQId]; system.debug('########### group Members for the Queue ID'+ tempQId +'are :'+ gMembers); return gMembers; } }
Are you getting the values in all the debug statements?
Thanks!!
None, I passing the following from anonymous window.