Hi all, In some cases we can need to copy financial dimension from one object to other for example Customer to Sales order or Vendor to purchase order.
In Ax 2012 it little easy. But in D365 For finance and operations, it is little bit tricky.
I did this with following code snippet. With the help of out of box. LedgerDimensonDefaultFacade class i used the merge default dimension method and passed same table dimension in form and to dimension.
Result is interesting.
salestable.DefaultDimension= LedgerDimensionDefaultFacade::serviceMergeDefaultDimensions(CustTable.DefaultDimension,CustTable.DefaultDimension);