Get a list of available columns from Extended table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 12:37 PM
Hello.
I have some columns in a table (ParentTable). It is used as parent table for some other tables (Child1, Child2, ...).
How can I get in 1 request all column name from child table and in parent table ?
When opening System Definition -> Tables -> Child2, Table Columns is showing columns from both child and parent tables, but when using GlideRecord("sys_dictionary"), it is showing only columns from child table.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 12:48 PM
Use TableUtils, most specifically getAllExtensions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 12:57 PM
getAllExtensions will return a list of tables, but I need a list of columns in both parent and child table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 12:59 PM
Then use that array of tables to query the dictionary and return the results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 12:50 PM
Hi Nick,
Sys_dictionary table is actually a column specific to each table - it is a "collection" field type. You cannot use it to do what you are trying to do. If you want all the fields from say, incident (child of task), plus all fields from task (parent), use GlideRecord('incident').
Thanks
Laurie
Please mark Like, Helpful, or Correct as applicable.