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 ?

  • Suggested answer
    XM-22040801-0 Profile Picture
    XM-22040801-0 11 on at
    RE: javascript function in onload for all the forms

    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

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: javascript function in onload for all the forms

    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.

  • Verified answer
    Guido Preite Profile Picture
    Guido Preite 54,073 Moderator on at
    RE: javascript function in onload for all the forms

    yes

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 Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,468 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,289 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans