When we advise clients on best practices regarding the use of JavaScript versus Business Rules in Model-Driven Apps, we promote the use of BRs for simple client-side logic and JS for more complex real-time logic.
Below are some common scenarios for the use of JavaScript.
| SCENARIO | PURPOSE |
| UI Manipulation | Show/hide tabs, sections, or controls in real-time |
| Cross-entity data access | JavaScript can fetch related records whereas Business Rules are limited to the current record. Example use cases: – Lookup field pre-filtering based on related table query results – Checking the current user’s security roles to adjust the form accordingly – Querying related tables to display a custom alert banner |
| Complex conditional logic | JavaScript can handle nested conditions, loops, and multi-field dependencies |
Microsoft Documentation
Thanks to my colleague, solution architect Elise Xavier, for her contributions to this content.

Leave a comment