Microsoft KB Archive/874429

= How To Manipulate the Date in the OnChange Events =

PSS ID Number: 874429

Article Last Modified on 5/10/2005

-

The information in this article applies to:

 Microsoft Business Solutions CRM Software Development Kit (SDK), when used with:  Microsoft Business Solutions CRM 1.2

 Microsoft Business Solutions CRM 1.0 

-



TechKnowledge Content
'''Issue

'''How to manipulate the Date in the OnChange events?

'''Resolution

'''To parse the Date from a Datetime field (activeon,in the example below) in the OnChange events

ParseDate(crmForm.activeon.value);

To get to the Month, Year, Date parts from a Datetime field in the OnChange events

var s=ParseDate(crmForm.activeon.value);

s.getMonth;

s.getYear;

s.getDate;

Months are stored in a zero based array, so increment it by 1 before you format it.

To get to the value of the Date in milliseconds for Date manipulation

var mydatevalue=s.valueOf;

To cast the value in milliseconds back to Date

var mydate= new Date(mydatevalue);

Disclaimer - Since the Datetime control is a custom control, it can change in subsequent releases, hotfixes, etc. in which case any dependent code in OnChange events may cease to work.

This article was TechKnowledge Document ID: 31149

Keywords: kbMBSMigrate KB874429

Technology: kbBizSolSearch kbCRM kbCRMSDK kbCRMSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.