Hi ,
i would like to set the state and status to open for phone call entity through web API .
could any one please help me on this .
Thanks,
Waseem
*This post is locked for comments
Hi ,
i would like to set the state and status to open for phone call entity through web API .
could any one please help me on this .
Thanks,
Waseem
*This post is locked for comments
Hi Waseem,
Below is a sample to open a phone call.
State |
Status Reason |
---|---|
0 : Open |
1 : Open |
1 : Completed |
2 : Made |
4 : Received |
|
2 : Canceled |
3 : Canceled |
var entity = {}; entity.statuscode = 1; entity.statecode = 0; var req = new XMLHttpRequest(); req.open("PATCH", Xrm.Page.context.getClientUrl() + "/api/data/v8.1/phonecalls(0000000-0000-0000-0000-000000000000)", true); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Accept", "application/json"); req.setRequestHeader("Content-Type", "application/json; charset=utf-8"); req.onreadystatechange = function () { if (this.readyState === 4) { req.onreadystatechange = null; if (this.status === 204) { } else { Xrm.Utility.alertDialog(this.statusText); } } }; req.send(JSON.stringify(entity));
Hope it helps
It worked .
Thank You .
Thanks,
Waseem.
Hello,
Use regular update approach passing statecode/statuscode as regular fields.
Good luck.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156