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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

javascript function in onload for all the forms

(0) ShareShare
ReportReport
Posted on by

I need to execute a JavaScript function in onload event of all the forms (nearly 15 forms I'm having). Do we need to add this function in each of the form ?

I have the same question (0)
  • Verified answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    yes

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    There is a way to do it in one go but it's a bit hacky - you can add the button to the entity's for ribbon and add the enable rule to it that has to always return false to hide it. You can put the logic you want to use inside and that's it.

  • Suggested answer
    XM-22040801-0 Profile Picture
    11 on at

    Yes, you must do it.

    To do it quickly, you can use Form Libraries Manager of XrmToolBox.

    - Load your solution (it must contain your forms)
    - Select the JS file
    - Select the forms in the right panel
    - Click on Add checked script
    - Select all forms to add the onload event (you can use the mouse or CTRL / SHIFT to select more than one)
    - Right click => Manage OnLoad events
    - Add your script and function

    pastedimage1679574408905v1.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 184 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 125

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans