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

Announcements

No record found.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,995 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,147 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 893

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans