Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

The GetObjectValue function returns a value that is not a date when you retrieve the date from a control in Microsoft Dynamics SL or in Microsoft Solomon


View products that this article applies to.

Symptoms

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.

↑ Back to the top


Cause

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

↑ Back to the top


Resolution

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)

↑ Back to the top


Keywords: kbprb, kbmbsvba, kbmbspartner, kbinfo, kbmbsmigrate, kb

↑ Back to the top

Article Info
Article ID : 914849
Revision : 2
Created on : 2/2/2017
Published on : 2/3/2017
Exists online : False
Views : 300