I'm using Dynamics 365 online v9.1. This is in Chrome (I can't test other browsers). Cleared cache/cookies etc.
I have some javascript trying to open an email record from a case onclick of a button in a WebResource.
On some cases it works fine but on others it opens a blank window and I can't see why it's going wrong or what the difference is. If it doesn't work on a certain case, it never works. If it does work then it always works so it's consistent in that regard.
var myactid = $(event.target).attr('data-myactid');
console.log(myactid);
var windowOptions = {
openInNewWindow: true,
entityId: myactid,
entityName: "email"
};
console.log(windowOptions);
window.parent.Xrm.Navigation.openForm(windowOptions);
console.log("window opened");
//var windowOptions = { openInNewWindow: true }; //deprecated method
//parent.Xrm.Utility.openEntityForm("email", myactid, null, windowOptions); //deprecated method
In both a working case and non working case the Guid is being correctly outputted to the console.
The only error I'm getting in the console on the non-working case has the correct Guid but looks like it's not including the base URL:
Not allowed to load local resource: file:///C:/main.aspx?etc=4202&extraqs=%3fetc%3d4202%26id%3d61d7a1a4-6c1a-e911-a979-000d3a388177&histKey=362358727&newWindow=true&pagetype=entityrecord
*This post is locked for comments
I have the same question (0)