Add Record in LedgerJournalTrans

Hi

I am adding Save Mode record in LedgerJournalTrans using the following code. Data is getting inserted into the tables but LedgerJournalTrans record is not showing in screen whereas if i add same value using the screen it works and same gets stored in table too.

ledgerTrans.TransDate= str2Date(‘16-jun-2015’,106);

ledgerTrans.Company= curext();

ledgerTrans.AccountType=LedgerJournalACType::Ledger;

ledgerTrans.Txt=‘Test’;

ledgerTrans.JournalNum = “FIPL-01926”;

ledgerTrans.CurrencyCode=‘INR’;

ledgerTrans.ExchRate=100;

ledgerTrans.TransactionType=LedgerTransType::GeneralJournal;

ledgerTrans.CompanyLocation_IN= 52565468087;

ledgerTrans.DocumentDate=str2Date(‘16-jun-2015’,106);

ledgerTrans.Approved=1;

ledgerTrans.insert();

You have not mentioned about the version of AX and hope you have a ledgerJournalTable related to it?

Look at some of the reference in standard code that actually does the insert into ledgerJournalTrans

Example: \Classes\CreditCardPaymentJournal\createJournal in AX 2012 R3

Look at the innerjoined tables to the LedgerJournalTrans in the form, they also need to be filled.

In case of R3 IN localization, you need to have the records in LedgerJournalTransTaxExtensionIN table as well.

Thanks Kranti,

I was missing LedgerJournalTransTaxExtensionIN table. It works now

can you mark it as the verified solution