Using Navision 5.0sp1.
I've just come across a problem with a dataport that imports a csv file. The first field is a text string and the next two are decimals. If it exceeds a certain length - which I assume is 256 chars. I get
You cannot enter '<my long text string which goes on for more than 256 chars>' in Decimal. The cursor is in front of the invalid character.
This error fires before the onbeforeinsertrecord trigger. I have the dataport set up to insert the three fields into three variables - which I then copy into the SalesLine.
So I can't intervene to chop the imported string... I think. David Studebakers book frustratingly says of OnBeforeImportRecord
'This trigger is executed before the next record is read in, allowing you to manipulate the external file before reading it.'
but he doesn't say *how* to intervene and manipulate the external file.
If I had access to the textline pre-parsing I would happily chop the offending field and handle the extra text after record insertion.
My immediate thought was to convert the little import routine to use bigtext - which I did. However Navision complains that you can't use a bigtext as a source for a dataport import field... you really do have to wonder about the people developing navision.
I have dug through the mibuso archives searching for dataport related topics but haven't found anything on the subject - so I'm obviously searching for the wrong thing since this can't be so esoteric a topic that noone has ever touched on it.
Can anyone offer a pointer on importing csv files with long lines of text?
thanks
Ian
Comments
The cause of my problems was a stray quote in my input file.
Coincidentally this file had unusually long text lines, so I jumped to the conclusion that the cause the long lines without looking at the text itself.
What a waste of a couple of hours time. ](*,)