Hello
when i open my webresource on click of button then I want to retrieve GUID of record from URL through js code..
Thanks & Regards
Hello
when i open my webresource on click of button then I want to retrieve GUID of record from URL through js code..
Thanks & Regards
Hello Yash,
You can use below code snippet to get the ID from URL:
const entityId = getUrlVars()["id"].replace('{', '').replace('}', '');
function getUrlVars() {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') 1).split('&');
for (var i = 0; i < hashes.length; i ) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
I think It might not work in Microsoft Edge Browser .
Hello Ajayendra I got it through this:
window.top.opener.frames[0].Xrm.Page.data.entity.getId();
for CRM above 2016 version :
André Arnaud de Cal...
292,494
Super User 2025 Season 1
Martin Dráb
231,305
Most Valuable Professional
nmaenpaa
101,156