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.

SCENARIOPURPOSE
UI ManipulationShow/hide tabs, sections, or controls in real-time
Cross-entity data accessJavaScript 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 logicJavaScript 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.


Discover more from The Low-Code Logbook

Subscribe to get the latest posts sent to your email.

Posted in , , ,

Leave a comment