Saturday 2 January 2021

Create Ledger Dimension through Code (x++)

          Create Ledger Dimension through Code (x++)


Microsoft has provided a service class which has a method provided  internally that merges the default dimension and the ledger account that you require.
This works only when you have default dimension & ledgerAccount that you want to merge .


LedgerDimension = DimensionDerivationDistributionRule::buildLedgerDimension(ledgerDimension,DefaultDimension);


Here the parameter Default dimension is the recid contains combination of your dimension values.
LedgerDimension is the LedgerMainAccount that is defaulted when you creating journals.


P.S : Default dimension creation code is provided in my another blog which return the RecId needed as aa parameter 'DefaultDimension' for the method buildLedgerDimension() in the above one liner code.

Blog for default dimension creation code : 

https://sbdynaax.blogspot.com/2021/01/c-reate-default-dimension-with-set-of.html

Thanks & Regards

Sindhu

No comments:

Post a Comment