Problem accessing DateTime data type used in dll - RTC

sridharsridhar Member Posts: 171
edited 2009-09-02 in NAV Three Tier
Hi,

I am facing problem in while accessing variable (of type DateTime )used in dll.

Here is the statement....

recAVATempSer.AVA_DocDate:=oGetTaxResult.DocDate (where AVA_DocDate is of type Date and DocDate is of type DateTime in dll)

There is no compilation error. But during runtime when ever the control execute the above statement the application is getting closed.

The Event log
Type: System.InvalidCastException
Message: Unable to cast object of type 'Microsoft.Dynamics.Nav.Runtime.NavDate' to type 'Microsoft.Dynamics.Nav.Runtime.NavDateTime'.


I thought this could be because AVA_DocDate is of type Date but DocDate is of type DateTime in the dll.
So I changed the data type of variable AVA_DocDate to DateTime. But now during the compilation time I am getting error as Type conversion is not possible because 1 of the operators contains an invalid type. DateTime := Date

There is no error poping up in NAV 2009 Classic. Please guide.

Thanks,
N.Sridhar
Sign In or Register to comment.