Set Financial dimensions for LedgerJournalTrans

LedgerJournalTrans ledgerJournalTrans; //MainAccount mainAccount; // Old way to do it ; ledgerJournalTrans.DefaultDimension = ledgerJournalTable.DefaultDimension; ledgerJournalTrans.LedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension( inventJournalTransMovement.LedgerDimension, ledgerJournalTrans.DefaultDimension); // Old way to do it /*mainAccount = MainAccount::findByLedgerDimension(inventJournalTransMovement.LedgerDimension); ledgerJournalTrans.LedgerDimension = DimensionDefaultingEngine::getLedgerDimensionFromAccountAndDim( mainAccount.RecId, DimensionHierarchy::getAccountStructure(mainAccount.RecId), ledgerJournalTrans.DefaultDimension);*/ // If AccountType is Ledger you must set OffsetLedgerDimension as set of financial dimensions // Otherwise you must set it as a link if (ledgerJournalTable.OffsetAccountType == LedgerJournalACType::Ledger) { ledgerJournalTrans.OffsetLedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension( ledgerJournalTable.OffsetLedgerDimension, ledgerJournalTrans.DefaultDimension); } else { ledgerJournalTrans.OffsetLedgerDimension = ledgerJournalTable.OffsetLedgerDimension; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.