When you use the GetObjectValue function to retrieve a date in Microsoft Dynamics SL or in Microsoft Business Solutions - Solomon, the function returns a value that is not a date. This problem occurs when you try to retrieve the date from any control that contains a date.


This problem occurs because the GetObjectValue function returns a string value instead of a date value.


To resolve this problem, convert the string value to a date value by using the StrToDate function or the StrToDateSep function.

The following is a sample of code that retrieves the date as a string value from the cDocDate control. The code then converts the string value into a date value that contains separators.

Dim strDate As String
Dim dDate As Sdate

dDate.val = GetObjectValue("cdocdate")
strDate = DateToStrSep(dDate)

MsgBox (strDate)

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!