21 February 2018

AX7 : D365 : How to merge ledger and financial dimensions using X++ code in AX 7 : D365

In D365 there is a new class for financial dimension merging. Return the default dimension id.

DimensionMerge

PurchLine::mergeDimension
{
return _dimensionMerge.merge(_primaryDefaultDimension, _secondaryDefaultDimension);
}
public DimensionDefault mergeDimension(
DimensionDefault _primaryDefaultDimension,
DimensionDefault _secondaryDefaultDimension = 0,
DimensionMerge _dimensionMerge = DimensionMerge::newFromTable(this,
this.companyInfo().RecId
)
)
{
return _dimensionMerge.merge(_primaryDefaultDimension, _secondaryDefaultDimension);
}


Below is the method where the parameters are passing and return final default dimension Id.

DimensionDefault mergedDimensionDefault;
DimensionCopy dimensionCopy;

// Now merge the dimensions
mergedDimensionDefault = LedgerDimensionDefaultFacade::serviceMergeDefaultDimensions(
_dimensionDefaultMap.DefaultDimension, // Values that are currently on the record
_defaultDimension1, // Input value 1
_defaultDimension2); // Input value 2

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...