Dataport Import
roshini
Member Posts: 122
Hi Experts!
While import file through dataport, I would like to import only lines starting with 7, remaining all lines, I want to skip.
Is there any function available for dataport.skip ??
While import file through dataport, I would like to import only lines starting with 7, remaining all lines, I want to skip.
Is there any function available for dataport.skip ??
0
Answers
-
sure you can do that.
I don't know what your data looks like or what table you're trying to populate - but if you import your data into variables you can use
Testfield := copystr("first field",1,1);
if testfield = 7 then begin
map your variables to nav fields
end else begin
currdataport.skip;
end;0 -
Hi Savatage,
Thank you for your reply.
Sorry, I could n't explain properly. As I have .CSV file, having data. All character and Numeric.
I need to import only starting lines with 7.
in my data file, other lines starts with 1 or 2 and other numbers. But import only line starting with 7.
before insert only, I would like to check, and insert only line starting with 7.
as other lines having more numeric data, so I am getting errors.
here I need to read the data file, before insert.0 -
As I said - Create variables as substitues for the fields you want to import your data to.
if the fields you want to import are called
CODE
NO
ZIP
then for example - create
importedCODE
importedNO
ImportedZIP
FieldCheck
enter these variables into your dataport fields not the real nav fields.
Onafterimport triggerfieldcheck := copystr("importedCode",1,1); if fieldcheck = '7' then begin validate(code,importedcode); validate(no,importedno); validate(zip,importedzip); end else begin currdataport.skip; end;
if you import into variable nothing gets put into your nav table until you map it to its corresponding nav field. good luck!
you could always open your file in excel - sort it & delete all the lines that don't start with 7 & then save it back to csv - but that's no fun!0 -
Hi Savatage,
Thanks a lot for detailed explanation.
Great!!0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions