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

Notifications

Announcements

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

I have the same question (0)
  • 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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 38 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 19 Most Valuable Professional

#3
TAHER Mehdi Profile Picture

TAHER Mehdi 13

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans