Making certain records show from a reference field

matthew_hughes
Kilo Sage

I've got a reference field that has a parent field populated:

 

matthew_hughes_0-1719906143676.png

 

The Level field is based on the hierarchy of a record e.g. a parent can have child records and grandchild records.

 

What I'm wanting to accomplish for the Parent field is that a user can select another record as the Parent, but it must show a list of records that are at the same level as the parent e.g. if I clear out the value of the current Parent, I expect to see a list of records at level 1 and that would be the same at different levels.

 

Does anyone know how I can accomplish this?

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@matthew_hughes I am assuming that there is a level field defined on the table where the parent record exists. If this assumption is correct then you can define an Advanced reference qualifier on parent field and set 

javascript:'u_level='+current.u_level;

Here I am assuming that parent table has a field u_level and the current record also has field with name u_level.

 

Hope this helps.

Hi @Sandeep Rajput . I tried using 'javascript:'u_level='+current.u_parent.u_level;' within the Parent field

 

Whilst it does show the records at the correct level. However what I did notice was that if clear out the Parent field and search for records at the level of the parent, non appear:

 

matthew_hughes_0-1719992376795.png

 

I was just wondering what else I need to do to stop that from happening?

 

@matthew_hughes Try using the following

 

 

javascript: if(current.u_parent){'u_level='+current.u_parent.u_level;}