Introduction
Slow forms frustrate users and hurt adoption. Model-driven app forms can lag when they're overloaded with JavaScript, subgrids, or unnecessary components. Here are five practical tips to keep your forms fast.
1. Minimize Form Tabs and Sections
Every tab and section adds overhead. Avoid the "everything on one form" approach.
Do:
- Use focused forms: only show fields relevant to the current business process
- Use form ordering and client-side form switching for different scenarios (Create vs Update, different record types)
- Collapse optional sections by default
Avoid:
- Dozens of tabs with hundreds of fields on a single form
- Duplicate sections that repeat the same fields
2. Lazy Load Subgrids
Subgrids load data when the form loads. Too many subgrids (or subgrids with large datasets) can slow the initial render.
Tips:
- Use View selector to let users choose which related view to load
- Limit the default view to a small number of columns and a reasonable page size (e.g., 25 rows)
- Consider using a quick view or drill-through instead of embedding a heavy subgrid
3. Optimize JavaScript
Form scripts run on load and on every change. Bloated scripts are a common performance killer.
Best practices:
- Load only the scripts you need for that form
- Use
async/awaitfor Web API calls — don't block the UI - Debounce handlers for
onChangeevents (e.g., search-as-you-type) - Avoid
getValue()in tight loops; cache values when possible - Remove deprecated
Xrm.Pageusage; useexecutionContext.getFormContext()instead
4. Use Appropriate Field Types
- Lookups — Limit the view to essential columns; avoid
$expandwhen not needed - Option sets — Prefer local option sets for small, static lists
- Multi-select option sets — Use sparingly; they add complexity and load time
Also: disable Auto-save when it’s not required. It triggers extra round-trips and can conflict with custom logic.
5. Publish and Clear Cache
- Publish customizations after changes — unpublished changes can cause inconsistent behavior
- Clear browser cache and test in an incognito/private window when debugging
- Disable unused form events — If you're not using
onSave, don’t register it
Quick Checklist
- [ ] Reduce tabs and sections to the minimum needed
- [ ] Limit subgrids and default view size
- [ ] Optimize and debounce JavaScript
- [ ] Use appropriate field types and lookup views
- [ ] Publish changes and test in a clean session
Summary
Form performance comes down to fewer components, leaner scripts, and smarter defaults. Start with the low-hanging fruit: trim tabs and sections, optimize subgrids, and clean up JavaScript. Your users will notice the difference.