How to populate new value in a field

Mehar Naaz
Tera Contributor

MeharNaaz_2-1693982756004.png

when Impact Category's  state is pending, I want below field values to be populate Blank value, when the state is Complete it should populate the calculated value. Can anyone suggest solution for this query?

MeharNaaz_3-1693983009499.png

 

2 REPLIES 2

Anmol0496
Tera Expert

Hi @Mehar Naaz 

You can write a after business rule which runs after record inserted or updated. It will checks the value of each fields then sets the value as required.

Thanks and Regards

Anmol

MrGupta__
Tera Expert

Hi @Mehar Naaz,
You can tackle this problem in two ways:

1. Use onChange Client Script on the Impact Category field.

if(newValue == 'pending'){

g_form.clearValue('field_1');

g_form.clearValue('field_2');

}

else if(newValue == 'complete'){

//calculate the value for both the fields and use g_form,setValue('field_name',value);

}

2. Use After BR on the form and checks using current.impact_catagory.

if(current.impact_catagory== 'pending'){

current.field_1 = '';

current.field_2 = '';

}

else if(current.impact_catagory == 'complete'){

//calculate the value for both the fields and use current.field_name = value;

}

Regards,

Himanshu