Options

Issue in passing a String from NAV to a DotNet Method

I was trying to pass a text variable txtStartDate from NAV2017
to a DotNet Method: SomeMethod(String StartDate)

I found that when I pass a value directly to the DotNet Method like this (1) SomeMethod('2022-02-25T13:30:00')
it behaves differently than when I pass (2) SomeMethod(txtStartDate) [although I have assigned txtStartDate:='2022-02-25T13:30:00'];

For me DotNot Method works correctly in case of (1),
but DotNot Method doesn't work correctly in case of (2).

Is there something different between txtStartDate and '2022-02-25T13:30:00',
when I have already assigned '2022-02-25T13:30:00' to txtStartDate;

Is it becuase of difference between .NET datatype and NAV datatype. What do I need to do to resolve?
Do I need to do some conversion before sending to DotNet method which is expecting a String DataType?

Thank.
Fazle

Comments

Sign In or Register to comment.