When I am using the generated classes to retrieve data from my pages, I am getting a null reference exception when try to receive an IEnumerable<TreeNode> for a 'Pages' form control.
After debugging, mInstance is not null so I am unsure what is going wrong?
According to docs "This method returns an empty collection if the specified field does not exist or there are no associated related pages."
So it must be deeper... Does the relationship named in the field "RelatedPosts" exsist? Is any of the related items not published or removed?
Yeah I saw that it should be returning an empty collection and thought that something funky is going on.
Here are screenshots of my field and contents
Is this what you mean by does the relationship exist?
If I understood correctly you need to specify the Relationship NAME!
So you need to store the codename of the relationship in "RelatedPosts" field. Probably "isrelatedto" (default)
Please, sign in to be able to submit a new answer.