Skip header record on CSV when using XMLport

ricky76
Member Posts: 204
Does anyone know if this can be achieved?
0
Comments
-
Just create a Bool - Variable
Firstline - Boolean
-OnPreXMLPort-
firstline := true;
-OnBeforeInsertRecord- (or wherever you start processing)
IF firstline then begin
firstline := false;
currxmlport.skip;
end;Austrian NAV/BC Dev0 -
I don't believe this type of approach works on xmlports does it? I have tried this just to verify and it doesn't.0
-
I've spent the last 2 Months nearly eclusively designing XMLPorts and i approached that problem a LOT.
Its quite simple: Find out if you are in the first line. In this case just currxmlport.skip.
If you dont like my solution maybe this can help you out: http://mibuso.com/forum/viewtopic.php?t=54346Austrian NAV/BC Dev0 -
Hi ricky76,Wisa123 wrote:Just create a Bool - Variable
Firstline - Boolean
-OnPreXMLPort-
firstline := true;
-OnBeforeInsertRecord- (or wherever you start processing)
IF firstline then begin
firstline := false;
currxmlport.skip;
end;
I agree with Wisa123. That's correct solution. But we can't see your xml port design.
Best Regards,
YukonMake Simple & Easy0 -
If a have a decimal field in the csv file though and that column has a header of 'Amount' then i don't get the chance to access any triggers on the XMLPort except the onPreXMLPort before it throws an error at me.0
-
Hi ricky76,
That's is different error. If you don't mind, could you show your xml port at here. I hope someone also can help to you.
Regards,
YukonMake Simple & Easy0 -
Just wondering if anyone knows the solution to the difficulty that Ricky mentioned in his most recent post?0
-
I cant use the method recommended in this thread because it only works if all the elements are of the "Source Type" text. I was using this method but discovered that I couldnt perform the necessary field validation/assignment in code because of a problem with Xrec. I have to use the inbuilt validation of the XMLPort. To do that I need to import straight into the record variables, some of which are decimal.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