We are using Nav 2017.
I have C/AL code to calculate intercompany and do various other things.
Code Snippet
GenJnlLine.INIT;
EVALUATE(GenJnlLine."Posting Date", GetFieldStr('PostingDate'));
GenJnlLine."Journal Template Name" :='GENERAL';
GenJnlLine."Journal Batch Name" := 'INTERCO';
GenJnlLine."Posting No. Series" := 'INTERCO';
GenJnlLine."Document Type" := 0;
GenJnlLine."Document No." := DocNo;
GenJnlLine."External Document No." := '';
GenJnlLine."Account Type" := GenJnlLine."Account Type"::"G/L Account";
GenJnlLine.VALIDATE("Account No.", GetFieldStr('AccountNo'));
EVALUATE(Amt, GetFieldStr('Amount'));
GenJnlLine.VALIDATE(Amount, Amt);
GenJnlLine.Description := GetFieldStr('Descr');
GenJnlLine.VALIDATE("Shortcut Dimension 1 Code", GetFieldStr('COSTCENTRE'));
However when Omit Default Descr. in Jnl. is ticked against an account in chart of accounts I get a missing Description error. I have tried setting the description before setting the account without success.
How do I change my code to avoid this error?
Answers