Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Web API - how to retrieve statecodes and statuscodes

Posted on by Microsoft Employee

Hello, 

I went through a lot of advices but none gave me an answer - using Web API, how can I retrieve list of statecodes and statuscodes of each entity?

This request gives me all option sets' list of values except state/statuscode.

https://xxx.api.crm.dynamics.com/api/data/v8.1/EntityDefinitions(LogicalName='account')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Web API - how to retrieve statecodes and statuscodes

    Thank you, this is exactly what I was looking for!

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Web API - how to retrieve statecodes and statuscodes

    Hi,

    try this:

    https://URL/api/data/v8.1/EntityDefinitions(LogicalName='account')/Attributes/Microsoft.Dynamics.CRM.StatusAttributeMetadata?$expand=OptionSet

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Web API - how to retrieve statecodes and statuscodes

    Well, are you sure you can get what I need using that tool? Show me then :)

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Web API - how to retrieve statecodes and statuscodes

    Hi,

    are you sure?

    You can get the values for every type of entities native and custom, here some custom entities screenshots:

    crm_2D00_rest_2D00_builder.pngcrm_2D00_rest_2D00_builder.png0361.17646.Capture.PNG

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Web API - how to retrieve statecodes and statuscodes

    Yes I did but unfortunately that is not solution .... request based on this tool are related to particular record, so you can get state/status code for that particular record (s).

    I need list of values of state/status codes for each entity - native and custom.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Web API - how to retrieve statecodes and statuscodes

    Hi,

    did you try to create your request with the CRMRestBuilder tool?

    github.com/.../CRMRESTBuilder

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 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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans