Options

Decimal fields not considering separator via Web Service

lordnedoxlordnedox Member Posts: 7
edited 2010-07-14 in NAV Three Tier
Hi,
i've created a .Net client to show and update Dynamics Nav data through Web services.
Everything is fine, except for the update of decimal fields.
If i send a decimal number, i.e. 3.56D to the web service, a value of "356.00" is stored.

I'm pretty sure it's a Regional settings/Decimal separator issue, but i cannot find a solution.

I have Windows 7 in english, regional settings in Italian (decimal separator=comma), dynamics nav 2009 english+italian language pack.
Both the client and the server are on the same machine.
I already tried changing the language in Dynamics Nav or in Windows regional options, nothing changes.

How can I know what regional settings the Web service is using? Is there a way to debug the message I send to the server?

I really appreciate any suggestion, as i'm stuck on this.

Thanks
Regards
Marco

Comments

  • Options
    lvanvugtlvanvugt Member Posts: 774
    Marco,

    What happens if you use English (US) regional settings?
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Options
    lordnedoxlordnedox Member Posts: 7
    lvanvugt wrote:
    Marco,

    What happens if you use English (US) regional settings?

    Same result:
    Value sent: 7.775 (en-US format)
    Value stored: 7,775.00 (en-US format)

    I changed my regional settings, language in both Classic and Role Tailored Client, restarted both windows services.

    I even tried to change the decimal separator of "Network service" account in the registries, setting the "." as decimal separator.
    Nothing worked.

    If i send the value in a Text field, and in the "OnValidate" method convert it to decimal and set the decimal field, it works. But obviously I cannot do this for each decimal field I have.

    :cry:
  • Options
    lordnedoxlordnedox Member Posts: 7
    Debugging the Dynamics Nav Page (related to the web service), i can see that the value sent from the client is already in the wrong format, both using Italian or US regional options.

    Is there a way to debug the Web service instead of the Page? In Dynamics nav source folder i can find only pages/code units etc.. but no web services.

    Thanks
  • Options
    lvanvugtlvanvugt Member Posts: 774
    Sounds like you definitely did hit a bug.

    I recall working on the NAV 2009 project at MS we did hit various 'regional' issues, where it seemed to us - being a European team - typically US programming not (well) taking into account non-US formatting. But probably that's only a very subjective opinion. :wink:

    I would suggest to report this one directly to MS through Partner/Customer Source.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Options
    lordnedoxlordnedox Member Posts: 7
    Sounds weird nobody before noticed this issue.
    I mean, you just need to try to update a Decimal field using Web Services, no special operations.. :-k

    Anyway, just to add more information, i created a Java client to connect to the web service and do the same update, and it works perfectly.

    It seems a specific .Net issue, tried both VS 2008 (fw 3.5) and VS 2010 (fw 4.0) to be sure, nothing worked..
  • Options
    lordnedoxlordnedox Member Posts: 7
    SOLVED

    Downloaded and installed the hotfix:

    2/10/2010. KB978939. "Decimals may import incorrectly when importing with WebService on NAV 2009 SP1, if running on local (non-english) OS"

    Hope someone will find this helpfully.

    Thanks for your support \:D/
  • Options
    lvanvugtlvanvugt Member Posts: 774
    Great. =D>

    So...
    lvanvugt wrote:
    you definitely did hit a bug
    8)
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
Sign In or Register to comment.