how can we assign the value of one variable as a default value to another variable

Yash38
Kilo Guru

how can we assign the value of one variable as a default value to another variable

 

the 1st variable (Requested For) is a reference variable which refers to sys_user table and takes the default value as javascript: gs.getUserID() but the person who is submitting the request can change it some another user so that they can request on behalf of someone else.

 

2nd variable which i created is only visible on RITM and Task form and should take the default value as the value present in Requested For variable which end user selected while submitting the request.

 

what i need to write in default value of 2nd variable to achieve this.

 

Thank in advance.

1 ACCEPTED SOLUTION

Yash38
Kilo Guru

Found the easy way : 

 

 on submit client script can be used to copy variables with below script:

 

g_form.setValue('second_var_name',g_form.getValue('requested_for'));  // make sure if requested for is reference then the second variable should also be reference.

View solution in original post

5 REPLIES 5

Yash38
Kilo Guru

Found the easy way : 

 

 on submit client script can be used to copy variables with below script:

 

g_form.setValue('second_var_name',g_form.getValue('requested_for'));  // make sure if requested for is reference then the second variable should also be reference.