Hi,
A script is running onLoad of an opportunity form that is causing an error. It could be related to some security role changes but the error isn't a plugin one that I'm used to seeing regarding security.
Error: "Cannot read property 'getId' of null"
The script is:
function onDocumentsLoad() { var navDocument; if (Xrm.Page.ui.getFormType() == 1) return; var recordId = Xrm.Page.data.entity.getId().replace("{", "").replace("}", ""); var oTypeCode = Xrm.Page.context.getQueryStringParameters().etc; var CurrentFormId = Xrm.Page.ui.formSelector.getCurrentItem().getId().replace("{", "").replace("}", ""); if (Xrm.Page.getControl("IFRAME_Documents") != null) { Xrm.Page.getControl("IFRAME_Documents").setSrc(Xrm.Page.context.getClientUrl() + "/userdefined/areas.aspx?formid=" + CurrentFormId + "&inlineEdit=1&navItemName=Documents&oId=%7b" + recordId + "%7d&oType=" + oTypeCode + "&pagemode=iframe&rof=true&security=852023&tabSet=areaSPDocuments&theme=Outlook15White"); } }
From what I've read this might be a legacy thing if the script was written for 2011?
Can I either update the role (if that is the cause) or put a condition in there to handle the 'null'?
Thanks
*This post is locked for comments