Hi,
I create record in js with sdk
There is any way to get the guid of the created record?
Thanks!
*This post is locked for comments
Hi,
I create record in js with sdk
There is any way to get the guid of the created record?
Thanks!
*This post is locked for comments
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/lnkt_troubleticketSet",
data: JSON.stringify(entity),
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
async: true,
success: function (data, textStatus, xhr) {
var newEntityId = data.d.lnkt_troubleticketId;
alert(newEntityId);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus + " " + errorThrown);
}
});
Hi,
You can use the following code for getting the guid of the record.
var id =Xrm.Page.data.entity.getId();
This returns the ID of the record created.
Refer the link below.
https://crmbusiness.wordpress.com/2014/02/17/crm-2013-javascript-to-get-id-of-record/
Hope this helps
Thanks
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,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156