Anurag Tripathi
Mega Patron
Mega Patron

I have often seen this coming up as a question on this Community

  • Can we navigate to the Child table from Parent table?
  • How to dot walk from Parent table to extended table?

 

This is not only possible but it has been there for quite some time. This was just not very well documented so i am simplifying it for you all.

Problem:

Lets take an example where you have the handle for task table record(which is actually an incident) and you have to query a field on Incident table

var gr = new GlideRecord('task');
gr.addEncodedQuery('number=INC0000001');
gr.query();
if(gr.next())
{
gs.print(gr.incident_state);
}

Running the above script gives you UNDEFINED.

 

Explaination: The script above will give you 'Undefined' because you are on task table record, and incident_state is a field on incident table.

 

Solution:

 Now to get the result of the original script , we will modify it slightly and get the desired result.

var gr = new GlideRecord('task');
gr.addEncodedQuery('number=INC0000001');
gr.query();
if(gr.next())
{
gs.print(gr.ref_incident.incident_state);  //Change is highlighted
}

Running the above script will give you the result which is right and expected.

Want to Achieve the same from UI Filters

If you want to go a mile ahead and provide this functionality from UI filter as well, all You need to do is add this system property in your system, if not already present.

glide.ui.list.allow_extended_fields and set its value to true

 

Now From the UI , from any parent table, you will be able the extended tables as show below

find_real_file.png

 

 The ones with the + at the end represent the extended tables.

 

Hope this helps:)

 

2 Comments