Hello Experts,
I am using an HTML web resource to display a link in Dynamics 365 Dashboard so that when user clicks on it will take to a Tableau Report. Let's say the link to display in the Dashboard is "My Sample Report". Here is part of the HTML:
<tr>
<td>
<a style='color: blue;' onclick='openLinkInWindow('https://tableauURL');" href="#">My Sample Report </a>
</td>
</tr>
Since the Tableau URL is embedded in the HTML code, it cannot be managed by a user. So I am planning to create an entity to store Tableau URLs, therefore when there is any updates in the Tableau URL, Dynamics user can update the new URL in the entity record.
My problem is how do I get the field value (URL value from the entity) and pass in to the HTML file. Any suggestion?
Example:
Thank you!
Try not to use ClientGlobalContext.js.aspx as this is being deprecated (no date yet, but Microsoft have indicated it will be removed docs.microsoft.com/.../important-changes-coming)
"parent.Xrm
will be removed after the removal of the ClientGlobalContext.js.aspx
"
As per Microsoft Use one of the following:
a) Use a custom control created using Power Apps component framework instead of HTML web resources.
b) On forms, use the getContentWindow method of the web resource control.
c) If the getContentWindow method doesn't work, you can use parent.Xrm
to get to the Xrm
object inside an HTML web resource. If the HTML web resource is opened in a new window, then you should use opener.Xrm
instead.
This page has some example code for getContentWindow on it docs.microsoft.com/.../getcontentwindow
Hi,
Check following link:
docs.microsoft.com/.../GetGlobalContext-ClientGlobalContext.js.aspx
You simply need to add to your HTML body following line with reference to the script:
<script src="ClientGlobalContext.js.aspx" type="text/javascript" ></script>
Then you have access to the Xrm object as you would normally have when working with js scripts inside forms.
Hope this helps
Regards,
Konrad
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
102