Date/Time field depends on True /false field on Incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 11:35 AM
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.
how to achieve this Your solution is much appreciated.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 01:38 PM
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'.
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