Skip to main content
Hi,

Can anyone tell me,  Can we display the list of queues and public groups assigned to the particular user in report or dashboard?

Thanks in Advance.

Sarma
답변 6개
  1. 2019년 2월 25일 오후 2:09
    Hi Raj,

    i tried the below code. but no luck.

    trigger AssignQueue on Queue__c (after insert) {

        

        List<Queue__c> qu = new List<Queue__c>();

        Id userId = UserInfo.getUserId();

        

        List<Group> g = [Select id, Name,(select Id, UserorGroupId FROM GroupMembers where UserorGroupId =:userId) from Group where Type='Queue'];

        

        for(Group gp: g){

            Queue__c q = new Queue__c() ; 

            q.Queue_Name__c = gp.Name; 

            qu.add(q) ;

        }    

        insert qu;

    }