With the old organisation service, you could have a create request with a GUID attached to the entity object.
Trying to do the same via the WebAPI but struggling to find some good help.
*This post is locked for comments
With the old organisation service, you could have a create request with a GUID attached to the entity object.
Trying to do the same via the WebAPI but struggling to find some good help.
*This post is locked for comments
Hello,
I would suggest download CRMRestBulder and make your query. Try with this -
var entity = {}; entity.accountid = "02c9c4f7-2868-4074-8387-bb63aebf9ebf"; entity.name = "Goutam"; var req = new XMLHttpRequest(); req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/accounts", 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) { var uri = this.getResponseHeader("OData-EntityId"); var regExp = /\(([^)]+)\)/; var matches = regExp.exec(uri); var newEntityId = matches[1]; } else { Xrm.Utility.alertDialog(this.statusText); } } }; req.send(JSON.stringify(entity));
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