Hello:
I need to insert a value to the prioritycode field of Entity Incident
caso.Attributes["prioritycode"] = 2;
In docs.microsoft.com this is the type of prioritycode
prioritycode | Edm.Int32 |
Select the priority so that preferred customers or critical issues are handled quickly. Display Name: Priority Default Options
|
When I go to insert I get this error
Incorrect attribute value type System.Int32
Hi
You need to change this line:
caso.Attributes["prioritycode"] = 2;
To:
caso.Attributes["prioritycode"] = new OptionSetValue(2);
Because it is an option set the type must be OptionSetValue, not int.
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Abhilash Warrier
100
Super User 2025 Season 2
Suresh Kulla
72
Super User 2025 Season 2
DAnny3211
54