I have a Nav database that is calling a WebService in the same database (this lets me run a report in different companies).
The WebService is using login 'navadmin'.
In Navision, I am entering dates as 31/12/10 (even when I login as navadmin to the machine that is hosting the WebServices and open the RTC), but the WebService is showing this on the report as 12/31/10. In fact, I have to send the date to the webservice as 12/31/10, otherwise I get an error.
How can I change this?
Evidently, navadmin has the settings to view dates as 31/12/10 (both in RTC and Classic)- it's only when running a webservice that it interprets dates as 12/31/10.
There is a previous topic that mentions the User Personalisation table
http://mibuso.com/forum/viewtopic.php?f=32&t=38402
All the user personalization records have language ID 1033 (English - US).
However, when I changed this to 2057 (English - UK) on the navadmin record, restarted everything (Nav client, Nav Database Server, webservice), and ran the webservice, the Language ID was re-set to 1033, and reports still showing dates as 12/31/10.
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
http://mibuso.com/forum/viewtopic.php?f=32&t=45341
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
There is no WebServicesDefaultTimeZone key in CustomSettings.config
The registry contains a key for UTC, so it shouldn't be a problem. (The link you mentioned described an issue in R2 where services were starting and then stopping at once - I don't have that problem).
In any case, I suppose that date format should be independent of the timezone, since there could be people (or at least countries) using different date formats in the same timezone.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I was using FORMAT(StartDate,0,'<Month,2><Day,2><Year><Closing>'), which is accepted because the WebService is formatting dates as 12/31. The issue is why it is doing that when the same user sees dates as 31/12 in both classic and RTC.
I had a similar issue with dates and webservice calls.
The answer was setting a record in the User Personalization table. This allows you specify a particular user and the language code that they use. This seems to drive the date format that Navision uses. Does mean that you need a record per user that is going to make web calls.
Hope this helps.
Paul
I had changed it to 2057 (English - UK) on navadmin's record since the Web Service is running as navadmin. I restarted everything (Nav client, Nav Database Server, webservice), and ran the webservice, and the Language ID was re-set to 1033 (English - US), with reports still showing dates as 12/31/10.
The issue was that I had not properly imported the ENG (English UK) language pack.
I tried the language import again, imported the language even in Classic client, verified that I could see English (UK) as one of the language options in both Classic and RTC, even when running as navadmin (the user whose login details are used to run the Dynamics NAV Server), made sure that I had the proper files in the Service folder, and restarted the RTC and Web Services.
The Web Service then printed reports with dates in the required format.
Thanks to everyone for your help.
I was also having the same issues with date formatting due to Web Services, the suggestions in this thread worked wonders.
Thank you very much
Tony