Skip to content

Commit d05ad62

Browse files
authored
Create Readme.md
1 parent 69c730d commit d05ad62

File tree

1 file changed

+25
-0
lines changed
  • Client-Side Components/Catalog Client Script/Reusable GlideAjax Client Script

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
This solution provides a generic and reusable GlideAjax-based client-server interaction in ServiceNow that allows querying any table by passing:
2+
3+
Table name
4+
Key field and value
5+
Desired fields to retrieve
6+
7+
It dynamically returns field values from the server and populates them on the form, making it ideal for use cases like CMDB enrichment, entitlement lookups, or dynamic form population.
8+
9+
1. Client Script (onChange)
10+
Triggers on field change.
11+
Sends parameters to the Script Include via GlideAjax.
12+
Receives JSON response and sets target field value.
13+
14+
Parameters:
15+
sysparm_table_name: Table to query (e.g., sys_user)
16+
sysparm_key_field: Field to match (e.g., sys_id)
17+
sysparm_key_value: Value to match
18+
sysparm_fields: Comma-separated list of fields to retrieve
19+
20+
2. Script Include: DynamicTableQueryUtil
21+
22+
Processes incoming parameters.
23+
Queries the specified table and retrieves requested fields.
24+
Supports both standard fields and catalog item variables.
25+
Returns a JSON object with field values and display values.

0 commit comments

Comments
 (0)