How to populate new value in a field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 11:50 PM - edited 09-06-2023 03:41 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 12:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 12:53 AM
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