Business rule for clearing a value is not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 06:54 AM
I created a catalog item that has a variable called New Information Needed (this variable is a type = Yes/No). That variable is a Yes/No variable type and is REQUIRED. That variable is only visible on Task # 2 in my workflow which has a Rollback activity. So when the wf starts, Task 1 generates. I close complete the task, then Task # 2 generate and the New Information Needed variable is required. When you answer "yes" to that question and then mark the task Closed Complete - the rollback activity kicks in - which will cause Task # 2 to change from a state of Closed Complete to a State = Pending.
What I am looking to do is when that state changes to pending I want to clear the value of "Yes" in that task to "blank". I don't want any value in that field.
Here is my business rule which does not seem to be working:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 08:03 AM
Karen,
I was reading through this post and it is something very similar to something I am trying to accomplish. Can you share what the client script was you used to get this to work?
Thank you,
Russell

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 11:06 AM
Hi Russell,
Here is the client script that I used to get mine working.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var item = g_form.getReference('request_item', doItem);
//var count = mct_counter;
}
function doItem(item) {
if (item.cat_item == '476590f76f359300512f5e354b3ee471') { // Sysid of Catalog Item Name
if (g_form.getValue('state') == 2 ) {
if (g_form.getValue('mct_new_info') == 'Yes'){
g_form.clearValue('variable_name', ''); // This is my Yes / No variable
g_form.setValue('counter',parseInt(g_form.getValue('mct_counter')) + 1); // This is my single line text field
//g_form.setMandatory('trgt_release_date', true);
//g_form.setMandatory('assign_to', true);
}
//else {
// g_form.setMandatory('type_of_effort', false);
// g_form.setMandatory('assigned_priority', false);
// g_form.setMandatory('trgt_release_date', false);
// g_form.setMandatory('assign_to', false);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2019 06:23 AM
It worked in a Before BR with
gr.field = '';
I had an issue before, that it didnt reach the statement, so the value was not cleared.