Schedule job on 2nd sunday of a month

Community Alums
Not applicable

Hi All,

I would like to run a schedule job on 2nd Sunday of a month.Can we directly get the week through any function?

Regards,

kirti

8 REPLIES 8

bernyalvarado
Mega Sage

Hi Kirti, I believe you could manage this through the schedule definition. See below what the wiki says about this:



2.3 Repeating Monthly Schedules

For monthly schedules (Repeat is set to Monthly) that start on a particular day of the month (Monthly type is set to Day of the month), you can specify the following options:


  • How ServiceNow computes the starting day each month. See Day of the Week.

...


2.3.1 Day of the Week

ServiceNow offers two methods to compute what day of the week a monthly schedule repeats on:  


  • Day: This method computes the day of the week to repeat on by determining the order of the selected starting date within the month. For example, if the selected starting date appears on the first Monday in the month, the schedule repeats every first Monday of every month.
  • Week: This legacy method computes the day of the month to repeat on by determining what week number the selected starting date appears in the month. For example, if the starting date is a Monday during the second week of the month, the schedule repeats the second Monday of every month.

The system property glide.schedules.repeat_nth determines what method your instance uses to compute what day a repeating monthly schedule occurs on. By default, instances use the more accurate Day method.


Note


Note: Use the Week method to maintain backwards compatibility with customized schedule logic.

source: http://wiki.servicenow.com/index.php?title=Using_Schedules#Repeating_Monthly_Schedules



Thanks,


Berny


Community Alums
Not applicable

Hi Berny,



This doesn't serve my purpose i have to insert few records dynamically.I was talking about Scheduled Script Execution



Regards,


kirti


Hi Kirti,



You mean to run a script in a scheduled job, right? The ones defined at System Definition >> Scheduled Job.



Thanks,


Berny


Community Alums
Not applicable

Exactly