The CreatorCon Call for Content is officially open! Get started here.

How to get table hierarchy in Scoped applications

Sandeep132
Kilo Sage

Hi all,

I am trying to get table hierarchy for a particular table using TableUtils script include. This is working fine for Global applications. If i apply the same for scoped applications i am getting "Illegal access to Script include" error because the TableUtils script include is restricted to only Global application.

Is there any other way to access the table hierarchy in scoped applications?

Thanks.

6 REPLIES 6

chidanandadhath
Kilo Guru

I'm using TableUtils in script include....below is the script...getTables contains GlideDBObjectManager

 

var tu = new global.TableUtils(sysClass);
var classHierarchy = tu.getTables().toArray();
ciClassH=classHierarchy.join(':');

Brent Llewellyn
Mega Guru

GlideTableHierarchy is the API used to get get table hierarchy in Scoped applications.

 

Specifically the code below will get it

var table = new GlideTableHierarchy("cmdb_ci_server"); 
gs.info(table.getTables());

 

Please mark helpful or correct if this solves your problem. 

 

Thanks,

Brent