Hi All ,
document.getelementbyid and document.getelementbyid.parentNode.insertBefore is not supported in D365
But i need to convert the above code to D365 supported solution . Turn on the legacy form rendering the existing code is working.
Please help me on this. Thanks in Advance.
var new_newcomaccountactive;
new_newcomaccountactive = document.getElementById("new_newcomaccountactive");
if (new_newcomaccountactive == null) {
new_newcomaccountactive = parent.document.getElementById("new_newcomaccountactive");
}
//if (new_newcomaccountactive && new_newcomaccountactive.checked)
//var new_newcomaccountactive = Xrm.Page.getAttribute("new_newcomaccountactive");
//debugger;
if (new_newcomaccountactive && Xrm.Page.getAttribute("new_newcomaccountactive").getValue() == true) {
var urlPermissions = GetCrmSetting("new.Com Website URL") + "/accountcenter/admin/Permissions.aspx?crmContactId=" + Xrm.Page.data.entity.getId();
var spannewComPermissionsLink = document.createElement('span');
spannewComPermissionsLink.style.marginLeft = '30px';
var hrefnewComPermissionsLink = document.createElement('a');
hrefnewComPermissionsLink.setAttribute("href", urlPermissions);
hrefnewComPermissionsLink.setAttribute("target", "PermissionWindowFromCrm");
hrefnewComPermissionsLink.style.color = '#0000ff';
hrefnewComPermissionsLink.style.textDecoration = 'underline';
var textnewComPermissionsLink = document.createTextNode("new.COM Permissions");
hrefnewComPermissionsLink.appendChild(textnewComPermissionsLink);
spannewComPermissionsLink.appendChild(hrefnewComPermissionsLink);
new_newcomaccountactive.parentNode.insertBefore(spannewComPermissionsLink, getNextElementSibling(new_newcomaccountactive));
}
*This post is locked for comments