Views:

Description

Returns the next working day given a date to start from.

Uses a Monday - Friday work week by default and the records defined in the business close calendar within CRM.

Signature 1

GetNextWorkingDay('startdate')

 

Signature 2

GetNextWorkingDay('startdate', 'usebusinesscalendar')

 

Signature 3

GetNextWorkingDay('startdate', 'usebusinesscalendar', 'workingday1', 'workingday2', 'workingday3', 'workingday4', 'workingday5')

 

Example 1

Returns the next working day given a date to start from. Uses a Monday - Friday work week by default and the records defined in the business close calendar within CRM.

GetNextWorkingDay('12/20/2012') Returns 12/21/2012 (US Format)

 

Example 2

Similiary to example 1 but explicitly setting usebusinesscalendar parameter and a Business Holiday set on 12/21/2012

GetNextWorkingDay('12/20/2012', true) Returns 12/22/2012 (US Format) 

 

Example 3

Like previous examples but shows how to change the days in the working week to a different set. Such as those in the UAE.

GetNextWorkingDay('12/20/2012', true, 'sunday', 'monday', 'tuesday', 'wednesday', 'thursday') Returns 12/23/2012 (US Format)

Parameters

Name Type Description Required
startdate xxxx xxxx xxxx