导航工具栏上的Dynamics Crm 365自定义按钮
问题描述:
在Dynamics Crm 365(在线)中,是否可以在导航栏中创建和显示自定义按钮/图标?
In Dynamics Crm 365 (online), is it possible to create and display a custom button/icon in the navigation bar?
答
我们通过这样做实现了.
We achieved by doing this.
添加/使用现有的功能区/命令栏按钮&它是启用规则作为快捷方式,可以从 javascript网络资源中以 Function 的身份执行以下脚本:[只需复制此脚本,更改 org_url &在浏览器开发人员工具栏控制台中运行它以查看其效果]
Add/Use an existing ribbon/command bar button & it's Enable rule as shortcut to execute the below script as a Function from javascript web resource: [Simply copy this script, change org_url & run it in browser developer toolbar console to see it in action]
var element = window.parent.document.getElementById("navTabGroupDiv");
var url = "http://<org_url>/_imgs/AboutBox.gif";
var para = document.createElement("img");
para.id = "myimg"
para.alt = "OhMyGod";
para.src = url;
para.style.float = "right";
para.style.height = "30px";
para.style.marginTop = "10px";
para.onclick = function () {
var webResource = 'test.html';
Xrm.Utility.openWebResource(webResource, null);
};
element.appendChild(para);
var Relement = window.parent.document.getElementsByClassName("navTabFiller");
if (Relement!=undefined && Relement.length > 0)
Relement[0].remove();
注意:不支持此DOM元素操作,但这是唯一的方法.
Note: This DOM element manipulation is unsupported but this is the only way.