- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 04:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 04:58 AM
Hi Kevin please try this code below replace sysparam with sysparm :-
ga.addParam('sysparm_name' , 'GetAssignedAsset');
ga.addParam('sysparm_user' , g_user.userID);
Also I would recommend to use GlideAggregate API for counting records instead of GlideRecord ( gr.getRowCount())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 06:27 AM
While reading also , in your script include you should change it form
this.getParameter('sysparam_user')
to
this.getParameter('sysparam_user')
Also try the below to convert it to string
this.getParameter('sysparam_user').toString()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 07:01 AM
updated it. Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 07:11 AM
All should be fine now.
If the question is answered please close the thread by marking my(or any other's) answers helpful/correct.
-Anurag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 06:10 AM
Hey,
It is Best Practice to use GlideAggregate for counting records.
"Use GlideAggregate for Simple Record Counting"
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
Hi,
I have a script include here where I get all the asset records of the logged in user and based on the no of records returned, I return some value to the client script. The client script uses the value to populate the variable of the catalog item. But, whatever the value returned from the script include is showing as null and the variable is not populating. Can You tell me what is wrong? I have attached the script