- 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 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 05:00 AM
Hi,
The code looks good to me. Can you please put some Info logs into the server side script include function.
Check where it is failing, also add an extra else (4th ) to return some random value like 'no_output'.
We have observed such behaviors in our custom application where end user does not return anything when we use glide record queries (because of ITIL role restrictions).
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 05:09 AM
Please add a log on your script include on line 8
gs.log('row count = '+user_list.getRowCount())
Check the logs later to see what are you getting exactly.
And yes on the Client Script make the following correction:
its not sysparam
its sysparm
so replace that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 05:50 AM
Yes, it is working. But the row count is showing crazy numbers when there are no assets tagged to the user. How can I correct that?
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