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,...
Answered

Add javascript to all pages or header tag

(0) ShareShare
ReportReport
Posted on by 10

I have common library that should be includede to all pages (forms/lists/dashboards and etc), this is important part.

Found some solutions, like edit Main.aspx - this is not possible because not work in Online

or add script to Ribbon -  but it look as bad solution.

Can't find right solution how make it. Any Ideas?

I have the same question (0)
  • Suggested answer
    Abby Kong Profile Picture
    6 on at

    I don't think there is any supported way to do this and don't think it's a good idea to temper with main.aspx even for for on-prem. This kind of unsupported change could bring huge headaches to you if you need to upgrade or migrate in the future. Can I ask why you want to add Javascript library to all pages?

    ------------------------------------------------------------------------

    If you have a JavaScript common library in a web resource:

    On each form where there is JavaScript you use the common library, add the common library into Form Library through Form Setting

    On list view where there is JavaScript depend on the common library, depend on the version of your environment is 9 or above or not, use Web Resource Dependency or add Custom JavaScript Action with isNaN (https://community.dynamics.com/crm/b/develop1/posts/ribbon-dependencies-in-version-9-isnan-is-no-more#)

  • Actimele Profile Picture
    10 on at

    For example, use library for display popup messages from websocket/notify for this should be loaded client on every page

  • Verified answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi,

    You can use a hidden button and inject the logic into an enable rule. This remains a workaround only.

    xrmtricks.com/.../

    Also, you can trigger a JS when your model-driven app loads. This could be useful:

    xrmtricks.com/.../

  • Suggested answer
    Actimele Profile Picture
    10 on at

    Yes, this solutions already viewed, but as you say - its workaround...

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 171 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 83

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans