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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics 365 Web API for Case Reactivation

(1) ShareShare
ReportReport
Posted on by 7

Does anyone know if there is Dynamics 365 Web API of Case Reactivation?
I know CloseIncident Action of Dynamics 365 Web API can close a Case, but can't find any Web API for reactivation.

And if not, can I use PATCH for updating statecode of Incidentresolution to "Canceled" and statecode of Incident to "Active" for Case Reactivation?

I'm afraid that it causes any data inconsistency and so forth, and wonder if there are some difficulties in implementation when the Web API has not been released from Microsoft.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Somesh2207 Profile Picture
    1,563 on at

    Hi Takayoshi Igi,

    You can do this by simply using the Web API Patch request. I tried and it is working with the Patch request. We just need to be sure to send statecode and status reason both in patch request. 

    For Case active state,

    State code will be Active (0) and status reason will be In Progress (1).

    you should send the below data for Incident patch request:

    var caseActivate = {"statecode":0,"statuscode": 1};
    This is how your patch request should look like :
    Pic1292017_5F00_5.png
  • Subramanya  Profile Picture
    165 on at

    Hi Takayoshi,

    This worked for me, Try this

    function ReactivateCase() {

       debugger;

       //update

       var clientURL = Xrm.Page.context.getClientUrl();

       var req = new XMLHttpRequest();

       req.open("PATCH", encodeURI(clientURL + "/api/data/v8.1/incidents(DC9E62A8-90DF-E311-9565-A45D36FC5FE8)", true));// your case ID

       req.setRequestHeader("Accept", "application/json");

       req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

       req.setRequestHeader("OData-MaxVersion", "4.0");

       req.setRequestHeader("OData-Version", "4.0");

       req.onreadystatechange = function () {

           if (this.readyState == 4 /* complete */) {

               req.onreadystatechange = null;

               if (this.status == 204) {          

                   alert("success");

               }

               else {

                   var error = JSON.parse(this.response).error;              

                   alert(error.message);

               }

           }

       };

       req.send(JSON.stringify(

           {

               statecode: 0,

               statuscode: 1

           }));

    }

    Thanks,

    Subramanya

  • Somesh2207 Profile Picture
    1,563 on at

    Yes it would work. That is exactly what I had posted.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans