web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Pass entity field value as a parameter in HTML web resourse

(0) ShareShare
ReportReport
Posted on by 197

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:

5875.Dashboard.png

Thank you!

I have the same question (0)
  • Suggested answer
    indyanin Profile Picture
    60 on at

    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

  • Suggested answer
    Fubar Profile Picture
    2,761 on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans