1

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.

Thank You

Regards, Lavanya

  • 4
    What is the API version of the Controller class? Try updating it to v39.0 – Daniel Ballinger Apr 20 '17 at 4:34
2

As per the comments, the issue will likely be with the API version of the Apex Class. Especially since the same query works in the Developer Console in Anonymous Apex.

As such, try updating the API version of the Apex class to v39.0 to match what the Developer Console if currently using.

  • Thanks Daniel.. It was the API version that caused an issue. – user3113331 Aug 3 '17 at 6:09

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.