Difference between revisions of "Calculated Value - busdateadd Function"

From SmartWiki
Jump to: navigation, search
Line 17: Line 17:
 
busdateadd(frm.startdate.value,1) returns 10/11/2008, Monday
 
busdateadd(frm.startdate.value,1) returns 10/11/2008, Monday
  
  startdate is a [[standard field]]. To calculate using [[custom field]] use frm.cf_fieldid.value.
+
  frm.startdate is a [[standard field]]. To calculate using [[custom field]] use frm.cf_fieldid.value.
  
 
[[Category:System Management]][[Category:Enhancements]][[Category:Custom Fields]]
 
[[Category:System Management]][[Category:Enhancements]][[Category:Custom Fields]]

Revision as of 13:37, 24 March 2009

The JavaScript "busdateadd" function adds a specific number of business days to a given date.

  • Syntax: busdateadd(datefield,business days to be added)
datefield could be a Standard field or a Custom field

It skips Saturday and Sunday and Canadian public holidays (not banking holidays).

  • (A US version will be available at a later date).

This is not related to any SmartSimple calendar.


Impact: This allows a calculation in a custom field based on business days instead of real days.

Example, Lets say field frm.startdate.value = 07/11/2008,Friday

busdateadd(frm.startdate.value,1) returns 10/11/2008, Monday

frm.startdate is a standard field. To calculate using custom field use frm.cf_fieldid.value.