Skip to main content

Notifications

Announcements

No record found.

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
    Community Member Microsoft Employee on at
    RE: Incident Entity PriorityCode type - Error to set Int32 value.

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans