How to run a NetSuite scheduled script at every month end

时间:2022-09-24 01:08:11

Background

Some times we need trigger a task at every month end, the last day of every month, i.e. cache business data.

Run a NetSuite scheduled script at every month end, can't be achieved by setup Script Deployment > Schedule:

 
 
 X    Repeat every 1   day(s)
 
 
     Repeat every weekday
START DATE 2/20/2019
 
START TIME6:00 pm
 
END BY 

When you hit 'Monthly Event', the option can't locate to the LAST day of every month.

 Day  of every  month(s)
 
  The 
How to run a NetSuite scheduled script at every month end
 
How to run a NetSuite scheduled script at every month end
 of every  month(s)

 

Steps:

1. Setup Script Deployment > Schedule to run for Every Day, I.e. 6PM (as above table)

2. Driven by saved search schedule can use this criteria to return result ONLY on last day of every month:

Formula (Numeric)

CASE TO_CHAR({today},'MM/DD/YYYY') WHEN TO_CHAR(LAST_DAY({today}),'MM/DD/YYYY') THEN 1 ELSE 0 END

Make this criteria equal to 1, will achieved results at the end of every month.