- 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:37 AM
Hi
getRecord(String table, String sys_id)
It Returns
If parameters are provided, returns the record identified by the provided table and Sys ID.
If no parameters are provided, returns the record identified by the current URL.
Returns null if the widget is embedded by another widget, or if the record for the provided parameters is not found.
- 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.