How to write reference qualifier for parent table reference record?

laszlobolya
Kilo Expert

Hello guys, may you can help me I'm a bit lost, again

So I have a table, call that lets say "Conference"

In the Conference Table I have "Cities". Each Cities have some "Conference Rooms" stored in another table. But I cannot select the room here, I need to select on a related tab.

Under the main Conference table, I have a related list "Book Conference Room" table.

When create New "Book Conference Room" I have option to select "Conference Room".

I would need a reference qualifier on this Conference Room   reference field, to display only Rooms are Connected to that "Cities" logged on "Conference" table...

So my problem is that it is not a assigned_to - assignment_group connection, because the "Cities" field on "Conference" table, and Rooms field on "Book Conference Room" table..

I hope you can understand me So far with a Business Rule on "Book Conference Room" I can display the Citiy value from Conference table like this:

BR display, on sn_conference_room table:

var gr = new GlideRecord('sn_conference'); //main Conference table

gr.get(current.conference);

var city = gr.city.getDisplayValue();

gs.addInfoMessage(city);

So the city value is correct, I can get it and use it. But I dont know how can I use this further? How can I list the "Rooms" for that City in a script include(?) so I can use javascript: referenceQualifier()? on the Room field.

3 REPLIES 3

laszlobolya
Kilo Expert

I have tried mostly with this help, but no success because I need to reference a parent table's record and dont knwo how to do that.


Advanced Reference Qualifier Using a Script Include - ServiceNow Guru


She Sull
Giga Guru

laszlobolya so you are on the Conference record trying to return only the Conference Rooms that are in the same city as the current Conference record? If so, you need to query the table that has the City to Conference Room relationship for records that have the current City. Use a Reference Qualifier to call the script include.



Advanced reference qualifier example


hello, thanks for the input. No, I'm not on Conference record but on a "child" Book a Conference Room.


So a different table I'm on which has a reference field for the Conference main table (the reference field name is just conference, stores the conference name). And also my child table has a reference field for room table.


Only the main Conference table has City field, which is a reference field for city table and each city has some room stored in an another table  


I cannot filter the Room reference field just to display the City's room where the conference placed.