Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

On hold reason field displays previous choice after save.

Ronald_T
Mega Contributor

Have added a choice in state called 'On hold'. Have created a UI Policy based on this - that will display a mandatory field called 'on hold reason'. Have added choices to 'on hold reasons'. When I select 'on Hold', the 'on hold reason' field appears, I select a choice, save the incident, now I change on hold state back to 'in progress' and save the incident. Now I change the state to 'On hold' and it should reset to 'none' as a choice, but it displays the previous selection instead. I've tried this with IE and Firefox - same results.

Any idea how I can fix it so that when changing back to 'on hold, the drop-down starts with None?

Thank you.

1 ACCEPTED SOLUTION

brianbeauchamp
Tera Guru

ronaldmoeller,

 

You can create an on update Business Rule to clear this value when the state changes from On hold.

 

When to run:

State  -- changes

AND

Change is not: On Hold

 

Actions tab:

Set value of On Hold Reason to blank

 

View solution in original post

5 REPLIES 5

kks,

 

You may have success with an OnHold client script.

 

Table: Incident

UI Type: All

Type: OnChange

FieldName: State

//Assuming your incidents are oob names and the state value of On Hold is 3
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   var state = g_form.getValue(state);
	if (isLoading || newValue === '') {
      return;
   }
if (state != '3'){
	g_form.setValue('hold_reason', '');
	
}  
}