Posts

Showing posts from February, 2023

Creating LedgerDimension from DefaultDimension in D365F&O

Image
  Its a very common requirement to create ledgerDimension, based on DefaultDimension. Generally we have a habit of hardcoding the dimension names, to get the resulting ledgerDimension value: ex -- dimensionMap.insert('CostCenter', '0033501_036'); dimensionMap.insert('Location', '2023GBG'); Where CostCenter, Location, Purpose, etc. are various financial dimensions. But wouldn't it have been great, if we could generalize the code, so as to eliminate dimension names hardcodes, so that if tomorrow the client decides to include more dimensions, edit or remove some of them, we don't have to change our code? This article can give you a very handy code to do the same. All you need to do is to call it correctly 😊 I have created a class separately: DimDimensionHelper. The following method has been added: public static Map getDimensionWiseDimensionValues_DefaultDimension(DimensionDefault _dimensionDefault)     {         Map dimMap = new Map(Type