Dim a As New NAV.Job_Service a.UseDefaultCredentials = True Dim b As NAV.Job b = a.Read("a-job-no") b.some_date_field = [color=#FF0000]???[/color] a.Update(b)
Luc Van Dyck wrote:Vjeko has written a blog posting about the 0D bug: http://navigateintosuccess.com/blog/bug ... services-2
Soren January 12, 2012 at 23:19
KB2606541 – https://mbs2.microsoft.com/Knowledgebas ... us$2606541
Seems like this should be the fix for it. But i have not tested it.
Answers
In .NET, it expects a "Date" variable.
With cdate("01/01/1753") it throws: "The * table contains a field with a date value that cannot be used with SQL Server".
\:D/
Did you even read mihail's post. He gave you the exact answer. ](*,)
Also, as I said, .NET function expects a "Date", not a "Datetime".
Can you explain it, please?
I published a function in a codeunit with a "date" parameter and a "datetime" parameter. Both are the same from .NET (both are "date" .NET type), and can't use sqldatetime.minvalue (wich seems to be the "null" value for Nav) with none ot them.
The problem seems to be that '1753-01-01 00:00:00:000' is not converted to '0D'. Maybe a regionalization problem? We got other problems related with dates and decimals due to diferences in representation.
I don't understand how to modify a date through a Nav web services without publishing a function. (ie, a page with its "modify" function or a function in a codeunit)
Please, check the workaround I added to the first post. Maybe it helps.
Thanks again.
Thank you too, mihail_kolev, for trying to help.
And for David Singleton an (optional) advice: Don't give such answers, even if you are right.
See you.
Hi,
1.
Has this hotfix been retracted?? if i click on download I cannot select the hotfix.
2.
Is this the latest hotfix or can I use a newer one to fix all problems?
2.- Sorry, I don't know.
The system is also being upgraded from 2009r2 to 2013r2.
However, we're experiencing the same issue when trying to update a record so that it has a "null" date.
When we set the value to either SqlDateTime.MinValue or CDate("1/1/1753") we get the same error as the OP.
It seems that the link to the "fix" is no longer available, but I believe I found the post by looking through the sites archives. However after looking at the post is doesn't seem to help when using web services. We're accessing the data through a published Page rather than a CodeUnit, and it seems like a huge overhead to call a function in a CodeUnit just to do something the page should already be able to do.
However, that's the approach we're going to have to take until this gets fixed properly.
For reference and for anyone else experiencing the same issue, the suggested solution is to extend the page with an extension CodeUnit and have a function for each date field you're likely to want to clear (set to a null date in Nav). You can then pass in the keys fields to identify the correct record, then set the date to 0D in code.