
[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.Thank You Regards,Lavanya1 réponse

Hi All, This is due to the API Version of the class. I changed it to 39 and everything worked perfectly. ThanksLavanya