在Microsoft Dynamics 365中显示外部应用程序表单 [英] Display external application forms within Microsoft Dynamics 365
问题描述
我们有自己的系统,需要与MS Dynamics 365集成.例如:在``帐户''部分,我们需要添加一个额外的选项卡来加载IFrame或从系统中检索一些额外信息的东西.
We have our own system which we need to integrate with MS Dynamics 365.For Example : In Accounts section we need to add an extra tab that loads IFrame or something that retrieves some extra information from our system.
以下是我所达到的目标:
The following are the things that I reached :
- 在新的仪表板中插入IFrame :(但不会获取特定的帐户信息,只会将当前登录的用户和组织名称一起传递)
- 统一服务台:(美元) :(我们可能会添加自定义功能,但这是一个桌面应用程序,需要在网络上使用)
- Microsoft Flow :仅在创建或编辑帐户时才能在后台运行(不确定其是否具有其他功能)
- 扩展:不确定如何使用它来实现相同的功能,我相信解决方案可能在这里,但我只需要从头开始.
- Inserting IFrame within a new Dashboard: (but it will not fetch specific account information, it will only pass the currently logged in user along with the organization name)
- Unified Service Desk (USD): (we may add customization but this is a desktop app and we need it to be on web)
- Microsoft flow: this would only work in the background when you create or edit an account (not sure if it has another functionality)
- Extensions: Not sure how to use it to achieve the same functionality, I believe the solution may be here but I just need from where to start.
有人做过类似的事情吗?
Has anybody done a similar thing before?
谢谢
推荐答案
您绝对可以做到, 这就是我刚刚尝试的一个跟踪实例的方式.
You can definitely do it, Here is how I just tried on one of my Trail Instance.
我根据需要添加了新的标签页,我将其称为"HTML页面"
I added new Tab as you need, I called it "HTML Page"
在此选项卡上,我添加了Webresource,您也可以添加iframe并调用您的外部WebPage. 对于我的简单用例,我在CRM中创建了一个简单的HTML页面作为webresource,并将其配置为如下所示的Webresource选项卡
On this Tab I added Webresource, you can add Iframe as well and call your external WebPage. For my simple use case I created a simple HTML page as webresource in CRM and configured it to Webresource tab as below
HTML的示例代码.不用担心长HTML文件.通常是bla bla.我们最重要的是<body onload="myFunction()">
然后是
Sample code for HTML. Dont worry about long html file. Mostly it is bla bla. What is of our importance is <body onload="myFunction()">
and then in
<script>
function myFunction() {
debugger;
alert("Account Id when from fromcontext is ");
alert(parent.Xrm.getformContext().data.entity.getId());
}
</script>
下面完整的HTML代码
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>My first styled page</title>
</head>
<body onload="myFunction()">
<!-- Site navigation menu -->
<ul class="navbar">
<li><a href="index.html">Home page</a>
<li><a href="musings.html">Musings</a>
<li><a href="town.html">My town</a>
<li><a href="links.html">Links</a>
</ul>
<!-- Main content -->
<h1>My first styled page</h1>
<p>Welcome to my styled page!
<p>It lacks images, but at least it has style.
And it has links, even if they don't go
anywhere…
<p>There should be more here, but I don't know
what yet.
<!-- Sign and date the page, it's only polite! -->
<address>Made 5 April 2004<br>
by myself.</address>
<script>
function myFunction() {
debugger;
alert("Account Id when from fromcontext is ", parent.Xrm.getformContext().data.entity.getId());
}
</script>
</body>
</html>
我还在帐户的表单加载中添加了其他Javascript.此javascript将创建可从您的webresource调用的全局变量. 文章
Also on Form Load of account I added additional Javascript. This javascript will create global variable which could be called from your webresource. Article Link for additional Javascript
下面用于Javascript的示例代码
Sample code used for Javascript below
formContext=null;
function onload(executionContext){
debugger;
var formContext = executionContext.getFormContext();
Xrm.getformContext = function (){
return formContext;
};
Xrm.getParentAttribute = function (attrName) {
debugger;
return formContext.getAttribute(attrName);
};
Xrm.getParentControl = function (attrName) {
debugger;
return formContext.getControl(attrName);
};
}
最终结果将如下所示
摘要:
- 创建Wberesource/iframe
- 在加载时创建Additiona Js
- 在您的网络资源中使用全局变量.
这篇关于在Microsoft Dynamics 365中显示外部应用程序表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!