SNOW-CAD User Interface Development Practice Question
A UI Macro on a form is causing slow load times. The macro uses multiple GlideRecord queries in its server-side script. The developer wants to optimize performance without altering functionality. Which action is most effective?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Replace GlideRecord queries with GlideAggregate and cache the results
Replacing multiple GlideRecord queries with a single GlideAggregate query reduces the number of database calls, improving performance. Caching the results further avoids redundant queries. Option A is incorrect because asynchronous loading does not reduce the total server processing. Option B is incorrect because moving queries to a client script via GlideAjax only shifts the load but still requires server-side processing. Option C is incorrect because g_form.addOption() is for adding options to a select field, which does not address the macro's performance issue.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Load the macro asynchronously using UI Macro configuration
Why it's wrong here
Asynchronous loading only changes timing, not the amount of server work.
- ✗
Move the queries to a client script using GlideAjax to reduce server load
Why it's wrong here
Moving to client side does not reduce total server processing; it may even increase it due to additional overhead.
- ✗
Use g_form.addOption() to populate a reference field instead of building the macro
Why it's wrong here
This changes functionality and may not apply to all cases.
- ✓
Replace GlideRecord queries with GlideAggregate and cache the results
Why this is correct
GlideAggregate reduces the number of queries by using aggregates, and caching avoids repeated calls, but caching alone may not help if data changes frequently. Actually, using GlideAggregate to combine queries is more effective than caching alone.
Go deeper
Related to this question
About these practice questions
This SNOW-CAD question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SNOW-CAD practice question is part of Courseiva's free ServiceNow certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SNOW-CAD exam.