- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 06:15 AM
Hi,
Want to confirm if this is just for me or everyone else.
$sp.getRecord() is working fine.
However, if I try $sp.getRecord('incident','<sys_id>'), it's not fetching the field values object in Widget Server script.
Greatly appreciate your help.
// Code Sample
var per = $sp.getRecord('incident','115d22e11b298d50e314c955624bcbeb');
data.per = per.getValue('state');
Thanks,
Krishna
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 01:31 PM
I implemented this with a workaround.
var per = new GlideRecord('sn_compliance_policy_exception');
per.get(<sys_id>);
var flds_per = 'number,short_description,state,u_type,justification,assigned_to'
var fields_per = $sp.getFields(per, flds_per);
Thank you for trying.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 06:30 AM
$sp.getRecord() does not accept parameters... Just returns the gliderecord object.
You could use a regular Gliderecord get() method instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 06:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 06:41 AM
Oops my bad.
Are you able to print out the value that it throws? undefined or something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 06:45 AM
I tried it. It prints blank.