Skip to main content

Error: Input string not in a correct format

Overview

When accessing Dynamics NAV through NAV Web Services, it is possible for the the error Input string was not in a correct format to occur.

Example text of error message:

An unexpected error has occurred:

Input string was not in a correct format.

System.FormatException

at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number,...

Cause

This error can occur when an application attempts to access Web Services and the Services Language setting is configured for a language other than the recommended default of en-US :

Resolution

  1. Recommended Solution

    insightsoftware strongly recommends setting the Services Language to en-US , as this is the default fixed culture for the Microsoft SOAP Web Services.

    Setting this to en-US will still allow users to set their NAV RTC display language to another desired language and will not affect the overall functionality of the client's NAV instance.

    Most applications, such as Jet Reports, are coded to work with Web Services in its default fixed culture (which is "en-US") so that all queries passed will work correctly and communications can be a constant.

  2. Alternate Option

    Another option, if you are still wary of performing this, would be to create a separate NAV instance specifically for Jet reporting with "en-US" as the "Services Language".

    A separate NAV instance for Jet reporting is the recommended practice for performance as noted in the following knowledgebase article: Jet reporting performance with NAV

    With the "Services Language" set to en-US the client computer will still be able to set their local region and language settings to another desired language and use the syntax "01/01/21..31/12/21" in Excel.

Was this article helpful?

We're sorry to hear that.