catalog client script to set vlaue

konijetisumanth
Giga Guru

hi i have a requirement to set value of Priority on Requested item based on 2 variables, x and y so i have written a client script on load to set value of priority based on x and y values, after submitting the req the values of priority is good , but when the assigned to updates the priority manually the changes are not getting updated.

 

can any one help me how to deal with this 

 

script written 

 

if (shipping_condition == '91' && exch_cat == 'Replacement') {
        g_form.setValue('priority', 1);
    } else if (shipping_condition == '92' && exch_cat == 'Replacement') {
        g_form.setValue('priority', 2);
    } else if (shipping_condition == '93' && exch_cat == 'Replacement') {
        g_form.setValue('priority', 3);
3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@konijetisumanth To allow changes to reflect on change of Priority, you need to write an onChange client script on the priority field.

but my priority is based on 2 fields , how can i do that 

@konijetisumanth I am assuming your priority is decided on the basis of those two fields and if any of those two fields changes then you need to update the priority as well. If this is the case then you need to write onChange script on both the variables on which your priority field is dependent.