make Calendar Date/Time field empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:30 AM
Hi
I have created a form with Calendar Date/Time field.
How to make this field empty when the date and time specified in it arrives.
This is the field type:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:42 AM
What's your use case behind this description "make this field empty when the date and time specified in it arrives."
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:46 AM
Later, I will also create a reminder email that will be sent to the assigned to to perform the task.
Right now I need to make the field empty when the specified time has arrived and the reminder has been sent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:47 AM
I have tried this business rule but it is doesnt work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:55 AM - edited 12-13-2023 02:57 AM
Okay got it now.
Business Rule may not be the most suitable approach since it triggers based on database actions. So that means a record will never clear the Reminder date unless there's some action on that record have performed.
To automatically clear the Reminder Date field when it's in the past, you can create a scheduled job that runs on a daily basis. Below is a sample script that you can use in the scheduled job:
1. Create a schedule job that runs on a daily basis.
2. Sample script execution.
var gr = new GlideRecord('u_quality_event');
gr.addNotNullQuery('u_reminder_date_and_time');
gr.addQuery('u_reminder_date_and_time', '<=', new GlideDateTime());
gr.query();
gr.u_reminder_date_and_time = '';
gr.updateMultiple();
Cheers,
Tai Vu