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

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

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

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans