0
votes

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. enter image description here

The following are the things that I reached :

  • 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?

Thank you

1
You can consider creating an HTML webresource, Pass the relevant information as query string parameter for the web resource. Within the webresource you can call the api of the external application to retrieve the data.imran chowdhury
Is there a way to add a web resource and attach it to each of the accounts? As the only place I saw the web resource was on dashboardsMahmoud-Abdelslam

1 Answers

2
votes

You can definitely do it, Here is how I just tried on one of my Trail Instance.

I added new Tab as you need, I called it "HTML Page"

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

enter image description here

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>

complete HTML code below

<!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&hellip;

<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>

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

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);
        };
}

Final Result will be something like below

enter image description here

Summary:

  1. Create Wberesource/Iframe
  2. Create Additiona Js on Load
  3. Use global variable in your webresource.