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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Web API - how to retrieve statecodes and statuscodes

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    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

  • Community Member Profile Picture
    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
    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
    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 :)

  • Verified answer
    ashlega Profile Picture
    34,477 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

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

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

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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans