- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 02:49 PM
Hi team. I'm trying to make a field display when a case record was created before 30/09/2023, however I'm having trouble trying to get it work. I'm not sure whether the date format and gliderecord to call the date is correct or not. Please note that our date format is dd mm yyyy
var createdDate = g_form.getSysCreatedOn();
var thresholdDate = new Date('30-09-2023');
if (g_form.getdisplaybox('account').value != 'ABC') {
if (createdDate < thresholdDate) {
g_form.setDisplay('u_fieldname', true);
} else {
g_form.setDisplay('u_fieldname', false);
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 05:39 PM - edited 10-08-2023 05:44 PM
Hi,
I would recommend using a UI Policy for this and then evaluating the date through the condition on the UI Policy, then in the UI Policy actions related list, select the field and choose "Visible" = true. This is a no-code and easy to implement solution and should always be done, if you can, before using a client script.
I see you're evaluating another field as well, you can also do that in the UI Policy much like the date evaluation I show in the screenshot above.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 05:39 PM - edited 10-08-2023 05:44 PM
Hi,
I would recommend using a UI Policy for this and then evaluating the date through the condition on the UI Policy, then in the UI Policy actions related list, select the field and choose "Visible" = true. This is a no-code and easy to implement solution and should always be done, if you can, before using a client script.
I see you're evaluating another field as well, you can also do that in the UI Policy much like the date evaluation I show in the screenshot above.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!