Reference field with a dependency with a dot-walk while using two custom tables

lrossy31
Tera Expert

Hello everyone,

Will appreciate the help to figure how to do filtering through either reference qualifier or dependency when using a dot walk reference field (Company) from first table, and a second reference field (on second table) which is the Organizations inside the company.

I will like to filter the options on the organizations depending on what company has been selected. I tried to use the dependency option but it is not working either since it does not work with dot walked fields.. again, Company field is dot walked to form of second table, when an option is selected then in the Organizations field which belongs to the second table (Organizations), it should show me only the organizations pertaining to the company selected.

The work is similar to what it is done here but the first field is a dot walk field from main table.

Any help will be greatly appreciated.

4 REPLIES 4

Anil Lande
Kilo Patron

Hi,

It is not possible to show data in dot walked field based on the field available on form.

Instead of using dot walk field create a custom field for Organization on your form and use the dependency logic as per your requirement.

 

Dot walk field is used to show related of Parent (company) field. If you modify dot walk field then the change/update will happen on Company record, not on the form.

e.g On incident form if you add manager field by using dot walk on Caller field. If you change Manager on dot walk field and save/update incident form then Caller's manager will be updated in User table. Similarly showing dependent values will not work on dot walk field, it is only for display purpose and we should always make those fields readonly on form to incorrect data modification.

 

Thanks,
Anil Lande  

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Found something that is close to what I want to do but just need to understand the ref qual. It is in the last comment of this link, Reference field with a dependency with a dot-walk - Developer Community - Question - ServiceNow Comm.... Let me know what you think.

Hi,

This link talks about dependency of parent field dot walking. (e.g. Show Users in another reference filed based on Callers manager by applying filter manager=caller_id.manager).

As I said before, we should not modify dot walked field, it would lead to a unwanted data modifications. You can test this scenario by modifying value of Organizations where it is added using dot walk. It will update company record, which is incorrect.

 

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Aman Kumar S
Kilo Patron

Hey,

Is there a direct relationship between organization and company?

You can have a ref qual in place:

javascript: "company_field_name="+current.main_reference_field.company_field_name.toString();// the name through which you are doing dot walk to bring company on the form

Best Regards
Aman Kumar