Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Set date to 1st day of next month based on other field

Chenab Khanna
Tera Expert

Hi,

I have 2 date/time fields (say, A & b) and need to set value on 1 field based on other.

So, whatever date/time value user selects manually in field A, then field B should be auto populated with 1st day of next month.

For eg, if user selects value of A as 4th april,2021 23:00:00, then value of B should be 1st May,2021 00:00:00.

1st will be constant for every value of A, only the month will change depending on month selected in A. Time will also remain constant as 00:00:00AM

Can someone help me with this?

6 REPLIES 6

var day = getMonth.getDayOfMonthLocalTime();

can you try this?

Did not work