Abstract: I and the public number: Microsoft Dynamics CRM experts in Rayong, reply 262 or 20170727 can be easily accessible this article, but also in the first to get my latest post information, follow me! My website is www.luoyong.me.
My previous article using the Fiddler Modify request information to perform a Dynamics 365 action (action) instance through the Web API with the help of the Fiddler tool, you might ask, can I only have a browser if I don't have a tool? This is what this article is going to tell you.
We know that the General browser press F12 will come out developer tools, we use chrome as an example to explain, or the same as the previous blog, do the same thing.
Please select the Developer tool Console this tab, in order to facilitate the input code, please clear this tab of the things, then I enter the following JavaScript code:
varClienturl =Xrm.Page.context.getClientUrl ();varreq =NewXMLHttpRequest () Req.open ("POST", encodeURI (Clienturl + "/api/data/v8.2/workflows (6BEBC426-F722-4B64-AE5D-0DA379F8A8C4)/ Microsoft.Dynamics.CRM.ExecuteWorkflow "),true); 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 = = 200) {Xrm.Utility.alertDialog ("Successful Execution!"); Console.log ( This. responsetext); } Else{Xrm.Utility.alertDialog ("Execution error. "); Console.log ( This. responsetext); } } };varRequestmsg ={};requestmsg.entityid= "B907de1b-cf99-e611-8161-000d3a80c8b8"; Req.send (Json.stringify (requestmsg));
Press ENTER after the loss, and soon the code execution is complete prompt me to succeed:
After I click OK, the code will get the returned content written to the console (console) as follows:
This is not a bit more technical work, need you will write JavaScript code, which brings the benefits I will not say, believe that smart friends can guess.
Perform a Dynamics 365 action (action) instance through the Web API in the browser without using a tool