sys_db_object - access specific table knowing name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 07:08 AM
im trying to come up with a method that i can access a table's sys_db_object record if we know the table's name, i am able to get to it if i know the label, otherwise id need to know the sys_id for this table, in the function im trying to use it in. i cant get its sysid from its name. does anyone know of any url parameters i can pass to access a table's sys_db_object directly knowing its name?
https://<<instance-name>>.service-now.com/sys_db_object.do?sys_id=<<table label>> works if we know the label, but with everything referencing table name, this just wont work for us.
thanks,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 07:44 AM
Hi @Jeffrey Siegel ,
Are you looking for below code ?
var gr=new GlideRecord('sys_db_object');
gr.addQuery('name','incident');
gr.query();
if(gr.next()){
gs.info("https://<<instance-name>>.service-now.com/sys_db_object.do?sys_id="+gr.sys_id);
}
Output :-
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 07:47 AM
no, unfortunately where i am working i cannot call a GlideRecord, ive even tried to call it via a script include and it wont work, i need to see if theres any url parameter i can use to access via the tables name. The table sys id and table label functionally work, but wont work for my need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 07:52 AM
Oh Okay.
I have no idea about that.