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 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 ?
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
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.
yes
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156