Category:
Updated on: August 30, 2025
|
0
Client Script Patterns 4
🔧 Client Script Patterns:
Examples & Scenarios
7) Performance & UX helpers
7.1 Batch UI changes to reduce repainting
7.2 Debounce expensive onChange logic
8) Security, integrity & edge cases
8.1 Prevent user from clearing mandatory due to UI policy flip
8.2 Guard rails when a CI is blacklisted
9) Troubleshooting checklist
-
Script runs but nothing changes?
Check exact field name (not label), and that you’re on the correct table/view. -
Random errors after copy/paste?
Ensure semi-colons and function signatures match the script type. -
GlideAjax returns empty?
Script Include must extendAbstractAjaxProcessor
and be Client Callable (in UI). -
Date comparisons fail?
UseGlideDateTime
for consistent parsing of platform date strings.
10) When to use UI Policies instead
-
Pure visibility/mandatory/read-only rules → UI Policy first (faster, simpler).
-
Client Scripts for complex logic, async lookups, or cross-field calculations.
Comments
No comments yet.