Merging a ledger dimension with a default dimension

I sometimes end up having to merge a ledger dimension coming from one place with a default dimension from another place. This could be the ledger dimension in a ledger journal line we need combined with a default dimension from customer.

It is pretty easy to do using the out-of-the-box classes in AX 2012. Here is a quick example:

myCombinedDimension = DimensionDefaultingService::ServiceCreateLedgerDimension(myLedgerDimension, myDefaultDimension);

That’s it! 🙂