Hi guys. I have the following script that I have embedded in a button on the leads form, which I'm using to call an html web resource:
var recordId = Xrm.Page.data.entity.getId();
var data = recordId;
console.log(data)
var pageInput = {
pageType: "webresource",
webresourceName: "cdsv_lead_fastDoxIntegrationPopup.htm",
data:data
};
var navigationOptions = {
target: 2,
width: 580,
height: 280,
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
// Handle dialog closed
},
function error() {
console.log(error);
}
);
I have been getting the following error in the console after pressing the button:
Unable to get property 'navigateTo' of undefined or null reference.
Is there a different way to call my script that i need to use in crm 2011? Because this works in the later versions of crm.
Thanks.