Ref qualifier dictionary entry + parent tables

Alex240
Giga Expert

Hello community!

I've got a custom table with a reference to Table (sys_db_object) and a reference to Field (sys_dictionary).

The reference to Field (sys_dictionary) has a ref. qualifier like: 

javascript:"active=true^name="+current.u_table.name.getValue()

It works fine for fields belonging directly to the table but it fails when the table is a child table and filter does not return the fields belonging to parent table.

Does anyone know how can I apply a ref. qualifier fetching all the fields?

 

Thanks in advance!

Cheers,

Alex

1 ACCEPTED SOLUTION

Solution:

Array(new TableUtils(current.u_table.name.getValue()).getHierarchy()).toString().replace("[", "").replace("]", "");

View solution in original post

7 REPLIES 7

Nice work Maik!

Your replies guided the author correctly towards the end solution as well as provided additional information that could be used to correct the answer they've marked as correct and led to the creation of an article being posted within the community.

Thanks for your efforts!

-Allen


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

that's known behavior.

if you go to dictionary of child it won't show fields from parent

you can enhance like this and it would work for both

javascript: var query; if(current.u_table.super_class == '') query = "active=true^name=" + current.u_table.name.getValue(); else query = "active=true^name=" + current.u_table.name.getValue() + '^ORname=' + current.u_table.super_class.name; query;

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, 

Thanks for your response. However, I assume it works only with one level of hierarchy, isn't it?

It would fail for most of the CMDB tables.

 

Cheers,

Alex