Date/Time field depends on True /false field on Incident form

Rajkumar Bokken
Tera Contributor

Hi All,

 

We have Escalated Filed (True/False) field  and Escalated Time field (Date/Time ) on Incident  and Request form.

Now I wanted to auto populate the date and time on Escalated Time field when Escalated field is marked as True and auto clear once it is unchecked.

RajkumarBokken_0-1713465106965.png

how to achieve this Your solution is much appreciated.

 

Thanks

1 REPLY 1

James Chun
Kilo Patron

Hi @Rajkumar Bokken,

 

If this doesn't have to be reflected on the client side, you can create a Business Rule.

Something like below, note that I am using the 'active' field instead of the 'Escalated field'.

 

JamesChun_0-1713472591787.png

The script of the BR will be:

(function executeRule(current, previous /*null when async*/) {

	if(current.getValue('u_escalated') == true)
	{
		current.setValue('u_escalated_time', new GlideDateTime());
	}
	else
	{
		current.setValue('u_escalated_time', '')
	}

})(current, previous);

Make sure you get the variable names correct, I noticed that you had typos on two custom fields.

 

Cheers