Search code examples
jsonrestdynamics-crmodatamicrosoft-dynamics

Dynamics 365 opportunity EntityType processid and stagename error


For a newly created Dynamics 365 Opportunity entity why is the processid GUID all zeros, should it not by the GUID for the qualify stage? Furthermore, why is the only other processid I see when closing the opportunity the 3e8ebee6-a2bc-4451-9c5f-b146b085413a. I expected to see this GUID in the qualify stage, but instead see all zeros. In this case once the opportunity is closed should it not show the GUID for close 919e14d1-6489-4852-abd0-a63a6ecaac5d? The stepname also appears to not update.

enter image description here

https://org.api.crm.dynamics.com/api/data/v9.0/opportunities?$expand=stageid_processstage&$select=name,processid, stageid, stageid_processstage,salesstage,stepname

{
    "@odata.context": "https://org.api.crm.dynamics.com/api/data/v9.0/$metadata#opportunities(name,processid,stageid,stageid_processstage,salesstage,stepname)",
    "value": [
        {
            "@odata.etag": "W/\"6752584\"",
            "name": "Test",
            "processid": "3e8ebee6-a2bc-4451-9c5f-b146b085413a",
            "stageid": null,
            "salesstage": null,
            "stepname": "1-Qualify",
            "opportunityid": "b5763e98-dabe-e911-a81f-000d3a18280a",
            "stageid_processstage": null
        },
        {
            "@odata.etag": "W/\"6752626\"",
            "name": "Test Again",
            "processid": "00000000-0000-0000-0000-000000000000",
            "stageid": null,
            "salesstage": null,
            "stepname": "1-Qualify",
            "opportunityid": "725a36a4-dfbe-e911-a81f-000d3a18280a",
            "stageid_processstage": null
        }
    ]
}

Turns out this is a deprecation issue.


Solution

  • This is because Microsoft deprecated processid, process stage name and few more info directly from main entity ( in your case opportunity) to new businesses process flow entity and its record.

    Do one thing go to advanced find and therein try to find entity ( name shall be your process name, for ex: oppportunity process or something) When you retrieve those records you will see for each opportunity record there is one record in this business process entity and there you find more details about your business process.

    Here in docs you find more info about it https://learn.microsoft.com/en-us/dynamics365/customer-engagement/customize/business-process-flows-overview

    And this is more relevant for you

    https://www.google.com/amp/s/www.inogic.com/blog/2019/02/business-process-flow-stage-name-in-dynamics-365/amp/