Error importing from .csv

Curtis2009
Member Posts: 13
Hi all, im developing a dataport to import data from a .csv file. I have a lot of blank dates, and im getting the error " '00000000' is an invalid date" when trying to import. Already tried
IF Date=< 0D then CurrDataPort.SKIP but it does not work. Already searched the forum and didnt find any solution, so any help will be appreciated. Thanks ](*,)
IF Date=< 0D then CurrDataPort.SKIP but it does not work. Already searched the forum and didnt find any solution, so any help will be appreciated. Thanks ](*,)
0
Answers
-
Instead of importing directly into the field, use a temp variable of type text.
Add code IF EVALUATE(DateField, TempText) THEN;
That way if you get a bad date it won't fill in the field. You could also do a SKIP here if you want to skip the record entirely.0 -
I would do something like:
IF NOT EVALUATE(DateField, TempText) THEN DateField := 0D;
By the way, you can evaluate incoming values in the OnBeforeEvaluateField trigger of the dataport field. That way you don't have to create a temporary variable.0 -
Thanks for the replys. Infortunately im still getting the same error ](*,) . I finally got a non blank date, and it's 20090930. I guess i need to convert this to navision standard right?
Edit: That was it, already solved. Thank you all \:D/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