How to get column name from parent table in sys_dictionary.

nikhilsoni973
Tera Contributor

So, In Dictionary table I am not getting list of column name from parent table which was inherit by child Table

and I need to generate list of column name of table including fields which is inherit by child table.

and I need to do that multiple table so that I cant do tablename.config and check.

3 REPLIES 3

Johns Marokky
Tera Guru

Hi @nikhilsoni973 ,

I am not getting your request clearly.

Any field that is created in the parent table will be inherited in the Child Table.

So Fields in Child Table = (fields from parent table) + Fields in Child Table.

if you want to get all the table columns of the parent table then there is an alternate way to get it.

Run the below script in background and it will give you all the tables that is related to the table you provided.

 

var a = new TableUtils('pm_project').getTables();  \\give the respective table name instead of pm_project
gs.print(a);

 

Then in the sys_dictionary give the condition as Table is one of "Answers from above script".

Screenshot 2023-02-22 at 7.50.34 PM.png

 

Mark helpful if it helps in solving your query.

 

Regards,

Johns

Hi johns,

Basically I need to generate report on tables. Like tables contains which all fields and in sys_dictionary parent field is not showing for child tables and I need field of parent field to be in report. The Way which you have been showed is manual. I need to go child table and check if it extends parent table then I need to put both of them in filter but what if I have 1000s of table.

Hi @nikhilsoni973 ,

For this there is no straight way. What you can do is that you can create a client callable script include and call this in your report.

See the screenshot for more reference.

Report:

 

ReportReport

Script Include:

Script IncludeScript Include

Script:

getTableNames : function(tableName){
		return new GlideRecordUtil().getTables(tableName);
	},

I think this would help.

 

Mark helpful and accept the solution if it helps in solving your query.

 

Regards,

Johns