Get a list of available columns from Extended table

whitewalker
Kilo Contributor

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.

5 REPLIES 5

Mike Allen
Mega Sage

Use TableUtils, most specifically getAllExtensions.


getAllExtensions will return a list of tables, but I need a list of columns in both parent and child table


Then use that array of tables to query the dictionary and return the results.


Laurie Marlowe1
Kilo Sage

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.