IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
Use this example when you want to retrieve a related item of an item, in case multiple items are not allowed. For example, you may have the limitation that a conference can have only one speaker. This means that to one conference item, you can relate only one speaker item.
In this case, if you use the GetRelatedItems method with the limitation to return a single item, you will get the error “Query execution found more than one element."
GetRelatedItems
This is because every item has two versions – the Master and the Live.
In this case, you can retrieve the single item, using the RelatedDataPropertyDescriptor in the following way:
RelatedDataPropertyDescriptor
By default, it applies status filtering and returns either a collection of items or a single item (when you have limitation on the field). It will return the related speaker with status corresponding to the item status – Master or Live.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important