problem with dataport and Gen.Journals

Hello Everybody !
This is my first post in this forum. I’m a beginner in using Microsoft Dynamics Nav and unfortunately I’m facing now problem.

I used a Dataport which load lines from an Excel file to the General Journals table.

My problem is that, when I examine the inserted lines on the table, the fields “Document Type” and “External Doc No.” are empty.

Besides, the value in the “Amount” field is 0, which is not the case in the Excel file.

What can I do to correct it???

Here is the code of the Dataport, if needed:


G/L Entry - OnPreDataItem()

G/L Entry - OnBeforeExportRecord()

G/L Entry - OnAfterExportRecord()

G/L Entry - OnBeforeImportRecord()

G/L Entry - OnAfterImportRecord()

"Gen. Journal Line".INIT;
"Gen. Journal Line".VALIDATE(“Journal Template Name”,“Gen. Journal Line”.“Journal Template Name”);
"Gen. Journal Line".VALIDATE(“Journal Batch Name”,“Gen. Journal Line”.“Journal Batch Name”);
"Gen. Journal Line".VALIDATE(“Line No.” ,“Gen. Journal Line”.“Line No.” + 10000);

IF “Gen. Journal Line”.INSERT(TRUE) THEN
"Gen. Journal Line".SetUpNewLine(“Gen. Journal Line”,Balance,FALSE);

"Gen. Journal Line".VALIDATE(“Posting Date”,DateCompt);

"Gen. Journal Line".VALIDATE(“Document Type”,“Type Document”);
"Gen. Journal Line".VALIDATE(“Document No.”,FORMAT(DocNum));
"Gen. Journal Line".VALIDATE(“Account Type”,“Gen. Journal Line”.“Account Type”::Customer);
"Gen. Journal Line".VALIDATE(“Account No.”,“N°Client”);
"Gen. Journal Line".VALIDATE(“Gen. Journal Line”.Description,Désignation);
//“Gen. Journal Line”.VALIDATE(Amount,Montant);
"Gen. Journal Line".VALIDATE(“Amount (LCY)”,Montant);
"Gen. Journal Line".VALIDATE(“Document Date”,“Date Document”);
"Gen. Journal Line".VALIDATE(“External Document No.”,“N° Documentf”);
"Gen. Journal Line".“Bal. Account Type”:=“Gen. Journal Line”.“Bal. Account Type”::“G/L Account”;
"Groupe Compta":=Customer.“Customer Posting Group”;
"Customer Posting Group".GET(“Groupe Compta”);
"Gen. Journal Line".VALIDATE(“Bal. Account No.”,“Customer Posting Group”.“Receivables Account”);

"Gen. Journal Line".MODIFY(TRUE);

DocNum += 1;

G/L Entry - OnPostDataItem()

ImportDataPar(NomF : Text[250];NomModFeuille : Code[10];NomFeuille : Code[10];DateComptabilisation : Date;“N°Doc” : Code[20])
"Gen. Journal Line".“Journal Template Name”:=NomModFeuille;
"Gen. Journal Line".“Journal Batch Name”:=NomFeuille;
"N° Document":=“N°Doc”;

try to validate amount(lcy) after external document no

I’ve just tried it and I still get the same result …

Did you contact your partner?

Why have you taken G/L entry as dataitem , if you are importing Gen. Journal Line data use that table as data item and then Validate it.


Faisal Bukhari

Why are you using G/L entry as dataitem , if you are importing Gen. Journal Line data use that table as data item and then Validate it.


Faisal Bukhari