Hi Dojo,
I am currently retrieving data from a DOM instance and need to retrieve a field value with the type GenericEnumFieldDescriptor, where the enum type is int.
I could use instance.GetFieldValue<int>(sectionName, fieldValueName, domCache);, but this will only retrieve the enum value, and I need to use the display name instead. Is there a way to retrieve the display name using .GetFieldValue?
Thank you!
Hi Carlos,
This is not possible.
What you can do is using the DOM Editor to generate c# code based on your definitions/sections/field descriptors and use that enum class to do your mapping.
Defining the value to display value mapping in the script as Jens suggest is the most performant way of doing this. If you however would want to make this more generic and dynamic, you could also just retrieve the SectionDefinition, and get the enum mapping dynamically like that.