The CreatorCon Call for Content is officially open! Get started here.

Want to populate date in custom field

Mark Wood
Tera Contributor

Hello Experts,

I have one custom table in which I have created three fields that is trigger type which is monthly,
Due day of month whose datatype is an integer, next schedule execution date whose data type is glide_date_time.
now my requirement is after the creation of the schedule I want to populate the next scheduled date in the next scheduled execution date field.
suppose today 25/10/2023 I am creating the schedule and my due date of the month is 26. now
next scheduled date should be 26/10/2023 how can I achieve this please guide me on this thank you.

1 REPLY 1

OlaN
Giga Sage
Giga Sage

Hi,

You can create a business rule, or a Flow that sets the value, whenever the due-day-of-month value changes.

A simple example below:

var gdt = new GlideDateTime('2023-10-25');
var dayMonth = 26;
gs.info('original date: ' + gdt.getValue());
gdt.setDayOfMonthUTC(dayMonth);
gs.info('modified date: ' + gdt.getValue());