Dynamically Populate a Field Based-on the Value(s) of Another Field

appstorm
Tera Contributor

I have been working on several on-change client scripts to make this work, but have so far been unsuccessful.  The task to make two fields that share the same table populate with their respective values, based-on the value of another field from the same table.

find_real_file.png

find_real_file.png

Below, is my script include.

find_real_file.png

 

How do I go about writing an on-change CS to make this work?

Thank you!

1 ACCEPTED SOLUTION

-O-
Kilo Patron
Kilo Patron

This is what I have defined in my PDI:

Hfind_real_file.pngHave added the fields to the Change Request form:

find_real_file.png

After flushing the cache, when I change System, Analyst and Owner automatically update.

View solution in original post

38 REPLIES 38

BALAJI40
Mega Sage

Hi,

Do you want to populate owner and analyst based onChange of the system or vice versa?

Correct, based onChange of system.

Please use the script suggested by Prasad Pagar.

Steven Parker
Giga Sage

In our instance, I filter a reference field based on another reference field by doing that following:

You could use an advanced Reference Qualifier on the reference field.  Here is our example:

"SOW Number" - Current reference field I am updating the Reference Qual on

"current.variables.customer" - form field reference to custom table

"u_client" - reference field on my custom table

Below is my Advanced Reference Qualifier on the "SOW Number" field.

javascript:'u_client='+current.variables.customer+'^u_active=true';

So basically this filters the "SOW Number" reference field by the "Customer" field which is also a reference field.  It only shows SOW numbers associated with the customer chosen that are active.


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven