Dataport Decimal Fields import problem with DecimalSeparator

EugeneEugene Member Posts: 309
There is a HUGE problem with Navision importing decimal fields from text file which has different from regional settings format for decimal fields

if i have a text file in which decimalseparator is '.' and at the same time in regional settings it is ','
then i cannot import decimal fields correctly. What i am forced to do in this case is to change all decimal fields with text fields and parse the text in code changing '.' with ',' and EVALUATE(Text) to Decimal. This is ugly solution so i want to ask -

Is it possible to use FORMAT property of Decimal field to import decimal fields regardless of regional settings ?

Comments

  • KowaKowa Member Posts: 925
    There are two triggers available for each dataport field :

    OnBeforeEvaluateField(VAR Text : Text[1024])
    OnAfterFormatField(VAR Text : Text[1024])

    where you can perform any desired actions with the imported text. In your case a CONVERTSTR with . and , as parameters in OnBeforeEvaluateField should be sufficient.
    Kai Kowalewski
  • EugeneEugene Member Posts: 309
    Thank You very much!!!
    This is exactly what i needed :)
Sign In or Register to comment.