Describe the bug
If you are working with an entity that has a EntityNameType-attribute for instance ActivityPointer it will crash if you try to access the attribute e.g. "activitytypecode" via the property ActivityTypeCode because it gets the attribute value as a String when it should get it as a OptionSetValue.
To Reproduce
Steps to reproduce the behavior:
- Generate context with the
ActivityPointer-included
- Try to use the
ActivityTypeCode property in code e.g. plugin or others
Expected behavior
The code should crash when you try to access the ActivityTypeCode property since it cant cast the OptionSetValue to a String.
Screenshots
Environment
- CRM/D365/CDS version: [e.g. 9.2.26043.00165]
- Tool version: [e.g. 3.0.1]
Additional context
// Context with casting issue
[AttributeLogicalName("activitytypecode")]
[DisplayName("Aktivitetstype")]
public string ActivityTypeCode {
get {
return GetAttributeValue<string>("activitytypecode");
}
}
Describe the bug
If you are working with an entity that has a
EntityNameType-attribute for instanceActivityPointerit will crash if you try to access the attribute e.g."activitytypecode"via the propertyActivityTypeCodebecause it gets the attribute value as a String when it should get it as a OptionSetValue.To Reproduce
Steps to reproduce the behavior:
ActivityPointer-includedActivityTypeCodeproperty in code e.g. plugin or othersExpected behavior
The code should crash when you try to access the
ActivityTypeCodeproperty since it cant cast the OptionSetValue to a String.Screenshots
Environment
Additional context