web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

xmlport import csv

(0) ShareShare
ReportReport
Posted on by 911

I have a CSV file as below and I'm trying and failing to import it into BC table: "Gen. Journal Line" (81) using an XmlPort.

"GENERAL","DEFAULT","TLPUK0099","","","95.460","01/01/2018"
"GENERAL","DEFAULT","TLPUK0099","Revalued Source","","-5.370","31/01/2018"
"GENERAL","DEFAULT","TLPUK0099","Revalued Source","REVERSING ENTRY","5.370","01/02/2018"
"GENERAL","DEFAULT","TLPUK0099","Revalued Source","","-8.500","28/02/2018"
"GENERAL","DEFAULT","TLPUK0099","Revalued Source","REVERSING ENTRY","8.500","01/03/2018"
"GENERAL","DEFAULT","TLPUK0099","Revalued Source","","-5.760","10/10/2019"
"GENERAL","DEFAULT","TLPUK0099","Revalued Source","","-5.760","10/10/2019"
"GENERAL","DEFAULT","TLPUK0099","Revalued Source","REVERSING ENTRY","5.760","01/05/2019"
"GENERAL","DEFAULT","TLPUK0099","Revalued Source","REVERSING ENTRY","5.760","01/05/2019"

Here's my XmlPort:-

xmlport 50000 XmlPortGenJrnl
{
Format = FixedText;
Direction = Import;
TextEncoding = UTF8;
UseRequestPage = false;
TableSeparator = '';

schema
{
textelement(Root)
{
tableelement(GenJournalLine; "Gen. Journal Line")
{
XmlName = 'GenJnlLine';
fieldelement(JournalTemplateName; GenJournalLine."Journal Template Name") { }
fieldelement(JournalBatchName; GenJournalLine."Journal Batch Name") { }
fieldelement(AccNum; GenJournalLine."Account No.") { }
fieldelement(Description; GenJournalLine.Description) { }
fieldelement(DocumentNo; GenJournalLine."Document No.") { }
fieldelement(Amount; GenJournalLine.Amount) { }
fieldelement(PostingDate; GenJournalLine."Posting Date") { }

}
}
}

var
myInt: Integer;
}

When I call XmlPort.Run(50000, false, true); in a Page extension action, I get error: Posting Date must have a value in Gen. Journal Line: Journal Template Name=, Journal Batch Name=, Line No.=0. It cannot be zero or empty.

Where am I going wrong? Any help would be greatly appreciated.

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 607 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 421 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 375 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans