[Salesforce]AggregateResultリストから項目値取得

AggregateResultリストから項目値取得

        List<String> testQueueUserIdList = new List<String>();

        for(AggregateResult gmObj : [SELECT UserOrGroupId, COUNT( Id ) 
                                FROM GroupMember 
                                WHERE GroupId IN ( SELECT Id FROM Group WHERE Type = 'Queue' And DeveloperName = 'testQueue') 
                                GROUP BY UserOrGroupId]){
            testQueueUserIdList.add(String.valueOf(gmObj.get('UserOrGroupId')));
        }
        System.debug('testQueueUserIdList : ' + testQueueUserIdList);

投稿者: kinkun

保有資格 Salesforce Certified Platform App Builder T Salesforce Certified Platform Developer I Salesforce Certified Platform Developer II Salesforce Certified Administrator

コメントを残す

メールアドレスが公開されることはありません。