web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Incident Entity PriorityCode type - Error to set Int32 value.

(0) ShareShare
ReportReport
Posted on by 20

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
TABLE 19
Value Label
1 High
2 Normal
3 Low

When I go to insert I get this error

Incorrect attribute value type System.Int32

  • Verified answer
    Community Member Profile Picture
    on at

    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.

    pastedimage1626335377514v1.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 60 Most Valuable Professional

#2
11manish Profile Picture

11manish 12 Super User 2026 Season 2

#3
Hamza H Profile Picture

Hamza H 8 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans