Value is not setting after reload via client script

Samiksha2
Mega Sage

Hi All,

 

I have a requirement to set the requested Item state based on some conditions.

In requested item table I have created one custom field= u_status

on change of u_status i have written a client script;

 

 

 var req_status = g_form.getValue('u_status');
    if (req_status == "Done" ) {
        g_form.setValue('state',3);
    }

 

 

Value is setting but after reload it again went back to Open state.

 

Please help me here.

 

Thanks,

Sam

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Hi @Samiksha2 The value is setting but did you save the form before you reload the form?

Regards
Harish

View solution in original post

4 REPLIES 4

Harish KM
Kilo Patron
Kilo Patron

Hi @Samiksha2 The value is setting but did you save the form before you reload the form?

Regards
Harish

Hi @Harish KM ,

My bad. I forget to add g_form.save().

Thanks,

Hi @Samiksha2 If my answer was helpful and your issue is resolved, please close the thread by accepting solution.

Regards
Harish

Harish Bainsla
Tera Sage
Tera Sage

Hi try this

var req_status = g_form.getValue('u_status');

if (req_status == "Done" && g_form.getValue('state') != 3)

{ g_form.setValue('state', 3);

}