I have a basic XMLPort to import a CSV file into the General Journal Line (81) BC table. This is working fine if I manually remove the header line at the top of the file.
I've seen various web-pages that say you can do something like the code below to skip the first line of the import-file. However, it still evaluates the data in the line instead of ignoring/skipping the line. It's reporting: "The length of the string is 21, but it must be less than or equal to 10 characters. Value: Journal Template Name".
1. Declare a global Boolean var (e.g.)
var
bFirstLine: Boolean;
2. trigger OnPreXmlPort()
begin
bFirstLine := true;
end;
3.
trigger OnBeforeInsertRecord()
var
begin
if bFirstLine then begin
bFirstLine := false;
currXMLport.Skip();
end;
end;
Am I using the wrong event perhaps? Any help would be greatly appreciated. Here's a sample of the data:-
"Journal Template Name","Journal Batch Name","Line No.","Account Type","Account No.","Posting Date","Document Type","Document No.","Description","Currency Code","Amount","Amount (LCY)","Shortcut Dimension 1 Code","Shortcut Dimension 2 Code"
"GENERAL","OPEN","6","G/L Account","TLPUK0099","01/01/2018","","00000400001","","EUR","100.000","95.460","",""
"GENERAL","OPEN","10","G/L Account","TLPUK0099","31/01/2018","","00000700001","Revalued Source","EUR","1","-5.370","",""
"GENERAL","OPEN","11","G/L Account","TLPUK0099","01/02/2018","","00000700002","Revalued Source REVERSING ENTRY","EUR","1","5.370","",""
"GENERAL","OPEN","14","G/L Account","TLPUK0099","28/02/2018","","00000800001","Revalued Source","EUR","1","-8.500","",""
"GENERAL","OPEN","15","G/L Account","TLPUK0099","01/03/2018","","00000800002","Revalued Source REVERSING ENTRY","EUR","1","8.500","",""