Find custom fields from List Items using Fluent API
Hi,
I would like to get a particular field which is created by me as custom field in list item using Fluent API. But I am not able to get it through Fluent API or I did not find any way to do it. Any help is appreciated.
Regards,
Harshil Shukla
Hi All,
I got my answer from this link :- www.sitefinity.com/.../how-are-custom-fields-in-lists-modules-accessed-through-code-behind
Thanks,
Hi Harshil,
I am glad you have found the solution. You can use the extension methods GetValue, GetValue<T> and SetValue() for working with custom fields. The extension methods are part of the Telerik.Sitefinity.Model, so you should include this namespace in order to use them.
Regards,
Nikola Zagorchev
Telerik
Hi Nikola,
Thanks for your reply. And definitely it has helped me a lot.
Regards,
Harshil Shukla
Hello Harshil,
I am glad you have managed to solve this out. Contact us if we can help you further.
Regards,
Nikola Zagorchev
Telerik
GetValue() definitely does not work for obtaining values of custom fields.
Hi
The GetValue is the method to get a value of a custom field. You can find more information here and here.
In your case, your custom field with name 'areaOfStudy' is not found in the PageData object. Please, check whether the field name is correct and your custom field is not added to another type, PageNode in your case maybe.
Regards,
Nikola Zagorchev
Telerik