Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Get Label StateCode in StatusCode in Case (Incident)

Posted on by 690

Hello everyone,

Asp.x have a page where I am displaying a gridview with data from the Case (Incident) created.

The Status Reason field in the select returns the Value example 100000000 and need to return the label such as "Complete".

Can anybody help me?

Thank you

*This post is locked for comments

  • Verified answer
    Felippe Profile Picture
    Felippe 796 on at
    RE: Get Label StateCode in StatusCode in Case (Incident)

    Yes Ricardo,

    You can make a "inner join" between incident and stringmap to return exaclty the information that you need.
    As follows:

    str_5F00_mp3.png

    Best Regards,
    Felippe Mendonça dos Santos


    If this helps, please "Like" and mark as "Suggested Answer"

  • RE: Get Label StateCode in StatusCode in Case (Incident)

    Fellipe,

    Thanks for answering me.

    I am using a query that the loading of the page we fill in gridview,
    In this case I would have to do a join with the sitemap table?

    Below the query that I'm using, could auxliar me better please confess I do not quite understand.

    select customerid, customeridname , ticketnumber, new_equipamentoid, contactresponsible,title, statuscode, createdon from Incident" 

    Thank you for attention

  • Verified answer
    Felippe Profile Picture
    Felippe 796 on at
    RE: Get Label StateCode in StatusCode in Case (Incident)

    Hi Ricardo,

    If u are using the SDK to retrieve the Entity class, this code will retrieve the label of the desired OptionSet

    Example:

    incidentEntity.FormattedValues["statuscode"].ToString();

    If you are querying directly on the Views of CRM Organization, the view: "StatusMap" contains the value that you wants:

    string_5F00_map_5F00_2.png


    The column"AttributeValue"  corresponds to the OptionSet value(int).
    The column "Value" corresponds to the OpstionSet label value(varchar)
    The column "ObjectTypeCode" identify the EntityTypeCode. You can see the values of all entities in your CRM version here:
    https://msdn.microsoft.com/en-us/library/gg328086(v=crm.6).aspx

    Best Regards,
    Felippe Mendonça dos Santos


    If this helps, please Like and mark as "Suggested Answer"

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans