Any idea why I get "sObject type CollaborationGroupRecord not supported" as compile error when I trying to query it in a trigger ?

I see that "Query()" is supported call in object description.


for(CollaborationGroupRecord CGR : [select id,CollaborationGroupId,RecordId from CollaborationGroupRecord  where RecordId IN : ObjFeedMap.keyset()]){

    if(!RecordRelatedGroups.containskey(CGR.RecordId ))
        RecordRelatedGroups.put(CGR.RecordId , new set<id>());



Interestingly same code works in a class but not in trigger. Trigger was on feeditem. Need to see if I call it from class what would happen.

Any help please?

  • Post your trigger code and/or the SOQL query you are using – Developer Wonk Sep 23 '15 at 23:56

"CollaborationGroupRecord requires a filter by a single Id, CollaborationGroupId or RecordId using the equals operator."

This SOQL will not execute because you cannot compare RecordId to the set of Ids returned by ObjFeedMap.keyset() even if that set only contains a single id

[select id,CollaborationGroupId,RecordId from CollaborationGroupRecord  where RecordId IN : ObjFeedMap.keyset()]

You will need to query a specific RecordId in your SOQL.

| improve this answer | |
  • i agree @Developer Monk – pnoytechie Sep 24 '15 at 0:43
  • I realised it . when it threw a run time error :). Thanks – Manjunath Nimbal Sep 24 '15 at 1:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.