Create Ledger dimension from string values

0

1 – By using the below code one can create ledger dimesion recId using X++
Combination of Main Account and DimensionValue

container offsetAccount;

RefRecId ledgerDimension;

offsetAccount = [‘11850000’, ‘11850000’, 3, ‘Department’, ‘101’, ‘Customer’,‘Cus-101’, ‘Vendor’, ‘Vend-101’];
//[MainAccount,MainAccount, NoOfDimensions, DimensionName, value]

ledgerDimension = AxdDimensionUtil::getLedgerAccountId(offsetAccount);

2 – Create Ledger dimension from main account (default account) and default dimension

The DimensionDefaultingService::serviceCreateLedgerDimension() method can be used to create ledger dimension from main account and default dimension.

JournalTrans.LedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(_defaultAccount,
JournalTrans.DefaultDimension);

Advertisements