---
title: Synchronous AJAX Call In UI Scripts
description: "Impact Area Performance Severity High Affected Element UI Scripts ## Rule ID **SN-0152** ## Impact Code that uses synchronous AJAX feels very slow. It is detrimental to the user experience. ## Remediation For data that can change during the user…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/servicenow-rules/synchronous-ajax-call-in-ui-scripts/"
updated: "2025-03-21"
category: Rules
---

# Synchronous AJAX Call In UI Scripts

Impact Area

Performance

           Severity

High

           Affected Element

UI Scripts

## Rule ID

**SN-0152**

## Impact

Code that uses synchronous AJAX feels very slow. It is detrimental to the user experience.

## Remediation

For data that can change during the user experience, replace `g_form.getReference` with `GlideAjax`, a callback function, and a custom function in a Script Include that returns only the needed information. For data that remains the same after the form loads and can be determined before the form loads, replace `g_form.getReference` with a Display Business Rule and g_scratchpad. If using `ge``tXMLWait`, replace with `getXML` and a callback function.

### Time to fix

40 min
