Object properties won't print
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2023 02:16 PM
Hi
I am trying to print properties of a user object in background script using the following:
var testUser = gs.getUser().getUserByID('test test 3');
gs.print(Object.getOwnPropertyNames(testUser));
and am getting the following error:
Evaluator: com.glide.script.RhinoEcmaError: Expected argument of type object, but instead had type object
script : Line(2) column(0)
1: var testUser = gs.getUser().getUserByID('test test 3');
==> 2: gs.print(Object.getOwnPropertyNames(testUser));
Not sure what I am doing wrong here?
Thanks
Mike
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 02:31 PM
Object.getOwnPropertyNames seems to work with GlideRecord object, so am interested to know how I can get this to work with
gs.getUser().getUserByID()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 02:55 PM
I found:
for 'Object.getOwnPropertyNames' documentation. Maybe that will help. And I've never gotten expected results when using un-documented APIs. Hopefully others here something more to offer.