A web resource is any static file — JavaScript, HTML, CSS, an image, an icon, or a silverlight/XAP file (legacy) — uploaded into Dataverse and made available for use inside forms, the sitemap, or ribbon commands.
Creating and naming web resources
Web resources use a prefix-based naming convention tied to your solution’s publisher (e.g. new_/account_form_script.js), and are created and uploaded from inside a solution in the maker portal. Keeping scripts organized under a consistent naming pattern (by table, by purpose) pays off quickly once a project accumulates dozens of them.
Registering a script on a form
- Upload the JavaScript file as a new web resource and publish it.
- Open the form in the form editor, go to Form Properties (or the modern event panel), and add the web resource as a form library.
- Add a new event handler, select the event (e.g. OnLoad), and specify the function name exactly as written in the script.
- Check “Pass execution context as first parameter.”
- Save and publish the form.
Versioning and caching
Browsers aggressively cache web resources. After publishing an update, users sometimes still see stale behavior until their browser cache clears — worth knowing when a change “didn’t work” immediately after publishing but resolves itself (or resolves with a hard refresh) shortly after.