I am trying to create a custom VF page using a Custom Controller for Community to display Groups.
My SOQL Query is
[SELECT CollaborationGroupId,CollaborationRole,CreatedById,CreatedDate,Id,LastFeedAccessDate,LastModifiedById,LastModifiedDate,MemberId,NotificationFrequency,SystemModstamp,NetworkId From CollaborationGroupMember Where NetworkId =: Network.getNetworkId() ];
This query works perfectly in Developer Console Query / Anonymous Block. However, I get the below Error when I try to save my Controller class.
No such column 'NetworkId' on entity 'CollaborationGroupMember'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
I have a System Admin Profile and I am not sure what I am missing here.