Attach a financial Dimension to a vendor

I have a customization in Invoice Journal(AP Invoice )which requires a ledger’s financial dimension be attached to the vendor.


Ledger :



Vendor: 211000

Now I want to make this look like the below examples in the voucher transactions.:



The assigning of values to the vendor account should happen on the actual posting of the Journal…

Now, how can this be done?I tried using DimensionDefaultingService::ServiceCreateLedgerDiemnsion and tried also merging Vendor and the ledger but failed.

The purpose of this is to split vendor balance according to financial dimension.

Thanks in advance.

Hi Guys,

Sharing you the solution to this.

My Colleague gave me this.

static void CombineLedgerDimensions(Args _args)


LedgerDimensionDefaultAccount defaultAccount;

DimensionDefault dimensionDefault;

LedgerDimensionAccount ledgerDimension;

DimensionDynamicAccount mainDimensionAccount,


container dimContainer;

int xy;

//Ledger Dimension of Vendor Balance: This is where Main Account should come from

mainDimensionAccount = 5637148157;

//Ledger Dimension of Ledger Type: This is where Financial Dimension should come from

finDimensionAccount = 5637147078;

dimContainer = AxdDimensionUtil::getDefaultAccountValue(mainDimensionAccount);

defaultAccount = AxdDimensionUtil::getDefaultAccountId(dimContainer);

dimensionDefault = DimensionStorage::getDefaultDimensionFromLedgerDimension(finDimensionAccount);

//Combined Ledger Dimensions

ledgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(defaultAccount, dimensionDefault);

// -------

//TODO: Please Remove

info(strFmt("%1", ledgerDimension));

dimContainer = AxdDimensionUtil::getLedgerAccountValue(ledgerDimension);

for(xy=1; xy<= conLen(dimContainer); xy++)


info(conPeek(dimContainer, xy));


// -------