Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

How do I fetch the Business Process Stages with OData API?

Posted on by

The default stages appear to be Qualify, Develop, Propose and Close but these can be customised. I'd like to be able to fetch these values from the OData API but I'm not sure what Entity I can select them from.

  • Suggested answer
    btc_dynamics Profile Picture
    btc_dynamics on at
    RE: How do I fetch the Business Process Stages with OData API?

    I had to select the workflowid and name from the workflow entity first to find the correct process. Following that I could select stagename from the processstage entity where _processid_value = workflowid

  • Emino273 Profile Picture
    Emino273 19 on at
    RE: How do I fetch the Business Process Stages with OData API?

    Hello,

    maybe you have only to filter the process stages for the processid you need.

    For example if you consider the entity Work Order and look for its processes you will find that it has a specific Business Process Flow called Work Order Business Process which has three different stages (Work Order, Schedule Work Order, Close Work Order) and its unique identifier.


    Processes of Work Order entity:

    WorkOrderBPF.png

    Stages of BPF:

    8625.Stages.png

    Then if you execute your query as follow

    Xrm.WebApi.retrieveMultipleRecords("processstage", "?$select=stagename&$filter=_processid_value eq unique_identifier").then(
    	function success(results) {
    		console.log(results);
    	},
    	function(error) {
    		console.log(error.message);
    	}
    );

    you will get three records (stages of the BPF)

    apicall.png

    Best regards,

    Ema

  • btc_dynamics Profile Picture
    btc_dynamics on at
    RE: How do I fetch the Business Process Stages with OData API?

    Hi Andrew,

    I'm not quite sure if this is correct or if I'm perhaps selecting the wrong properties. When selecting the stagename and stagecategory from processstage I was expecting < 10 results (Qualify, Propose etc.) but I get a load of results such as

    Flow_is_triggered_by_CFS_plugin

    Flow_is_started_by_IoT_plugin

    recordingsActionItemsDetails

    etc. all with stage category 0.

    I'm using this doc as a reference but perhaps it's not the same thing: learn.microsoft.com/.../processstage

    Many thanks.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,313 Super User on at
    RE: How do I fetch the Business Process Stages with OData API?

    Hello,

    It seems that you are looking for processstage entity - stackoverflow.com/.../dynamics-365-webapi-getting-business-process-flow-stages

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans