Dataport with log text string

imurphy
Member Posts: 308
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
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
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
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
but he doesn't say *how* to intervene and manipulate the external file.'This trigger is executed before the next record is read in, allowing you to manipulate the external file before reading it.'
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
0
Comments
-
Please ignore this - turns out I've been trying to track down a solution to a problem that wasn't there.
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. ](*,)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions