How to get the extended table names in a script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018 06:01 AM
Hi Team,
I want to get the all extended table names by passing a table name.
Example:"Incident,Problem,Change Request "these tables Extends the table name called Task.If I pass the Task Table I have to Populate those three tables "I...
Regards,
Gokulkraj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018 11:29 AM
If you phase any issue then it will help you.
Mark correct or helpful if it helps you.
Warm Regards,
Pranay Tiwari
| www.DxSherpa.com |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 08:23 PM
You can use TableUtils to get all tables that eventually extend a base table:
https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_TU-getTableExtensions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 11:03 PM
The instanceOf method works for this:
var incGR = new GlideRecord('incident');
var ritmGR = new GlideRecord('sc_req_item');
gs.info(incGR.instanceOf('task')); //true
gs.info(ritmGR.instanceOf('task')); //true
gs.info(incGR.instanceOf('incident'));//true
gs.info(incGR.instanceOf('sc_req_item'));//false