By x++, I would like to create a Fixed Asset Journal.
I'm facing to issue about populate LedgeJournalTrans.offsetDefaultDimension.
Part of my code:
ledgerJournalTrans.OffsetDefaultDimension = ledgerJournalTrans.getOffsetLedgerDimensionForLedgerType(
AssetLedgerAccounts::assetOffsetLedgerDimension(AssetTable.AssetId,
'MyBook', AssetTransType::Depreciation ),curExt());
ledgerJournalTrans.insert();
ledgerJournalTrans_Asset.initValue();
ledgerJournalTrans_Asset.RefRecId = ledgerJournalTrans.RecId;
ledgerJournalTrans_Asset.AssetId = assetTable.assetId;
ledgerJournalTrans_Asset.TransType = AssetTransTypeJournal::Depreciation;
ledgerJournalTrans_Asset.BookId = 'MyBook';
ledgerJournalTrans_asset.insert();
I used
ledgerJournalTrans.OffsetDefaultDimension = assetBook.DefaultDimension
but NOT work
I'm not able to get the FixedAsset default Offeset; I would like to copy the behaviour when I add the FixedAsset in Account field.
There is any way?
Example - I would like this behaviour by code:
I would like to copy in Offset the Fixed Asset Financial Dimension:
Thanks all.


You're using the wrong field. You should be using
LedgerJournalTrans.LedgerDimension/LedgerJournalTrans.OffsetLedgerDimensionNot -
LedgerJournalTrans.DefaultDimension/LedgerJournalTrans.OffsetDefaultDimensionDefaultDimension- This is your normal financial dimensions, minus the ledger bit. In your case, something like00000031-00000023-00000003LedgerDimension- This is the ledger bit + the default dimension. In your case, something likeBUIL-00000031-00000023-00000003, where theBUILis some sort of account.There are tons of resources online on how to create a LedgerDimension from a default dimension. You should look at
AxdDimensionUtilandDimensionStorage. Here's one resource - https://www.schweda.net/blog_ax.php?bid=553&wdl=enYour AssetBook has a DefaultDimension and you need to combine it with a main account to get a LedgerDimension.