Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
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,323 Most Valuable Professional 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

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