Script include sysparm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 01:55 PM
Could someone please help me explain what is sysparm_serial in the following script:
checkAssetSerial: function() {
var sno = this.getParameter("sysparm_serial");
var gr1 = new GlideRecord('alm_hardware');
gr1.addQuery('serial_number', sno);
gr1.query();
if (gr1.next()) {
return true;
} else {
return false;
}
Thank you
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 02:17 PM
It is the parameter name that a ajax client script sent to the function.
Please refer to client script and ajax calls.
Vinod Kumar Kachineni
Community Rising Star 2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 07:01 PM
It's a custom name (i.e. non-ServiceNow default) of a parameter that the developers of the script named to get a value of a serial number to query hardware asset table. If the serial number already exists in the hardware asset table, the function will return true. Otherwise, the function returns false.
Client script will call function checkAssetSerial() by setting this parameter.
.addParam('sysparm_serial', <serial number of hardware to check>);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 08:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 10:13 PM
hi
Thank you