Skip to main content

Notifications

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!

  • Suggested answer
    Fubar Profile Picture
    2,752 on at
    RE: Pass entity field value as a parameter in HTML web resourse

    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

  • Suggested answer
    indyanin Profile Picture
    60 on at
    RE: Pass entity field value as a parameter in HTML web resourse

    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

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

#3
Eugen Podkorytov Profile Picture

Eugen Podkorytov 102

Overall leaderboard

Product updates

Dynamics 365 release plans