How to make a dependency field for this table ?

1dusjhyahnt
Tera Contributor

Hi Guys , Please Help me this is urgent 

 

How to make a dependency field for three field in single table means when we select A , Automatically B triggered when we select B then automatically C triggered

Screenshot 2024-01-26 at 3.36.13 PM.jpeg

17 REPLIES 17

HI @Amit Verma 

 

but requested for only used for sys_user table??what i will do 

Hi @1dusjhyahnt 

 

Auto-Populate feature has nothing to do with any specific field like Requested For or any specific table. This feature applicable for any reference field  in catalog item . Based on reference field, we can populate another reference field value by dot walking.

 

Request you to read the articles which I shared in my previous reply for more clarity and give it a try.

 

Thanks & Regards

Amit Verma


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

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @1dusjhyahnt ,

 

You can do this using onchange client script as follow:

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

var test1 = g_form.getValue('test1');   // take the value of first variable for the check

if (test1 == 'some_value') {                   // check the value of first varible with value on which you wanted to populate the another variable.
g_form.setValue('test2', 'desired_value');    // set the value of second variable.
g_form.setValue('test3', 'desired_value');    // set the value of third variable.
}
}

 

 

If the second variable value changes afer populating you need to another onchange client script and set the value of third variable.

 

Also I will say please first check if the auto populate and depedent value option as suggested by experts. If that doesn't work for you. Surely you can use this method to get your work done.

 

Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.


Regards,

Siddhesh