Thursday, June 15, 2023

Code to create ledger dimension from mainaccount in d365 X++

 public void main(Args args)

{

DimensionAttributeValueCombination      dimensionAttributeValueCombination;

DimensionServiceProvider DimensionServiceProvider = new DimensionServiceProvider();

LedgerAccountContract LedgerAccountContract = new LedgerAccountContract();

DimensionAttributeValueContract ValueContract;

DimensionStorage        dimStorage;

List ListValueContract = new List(Types::Class);


LedgerAccountContract.parmMainAccount("110110");

LedgerAccountContract.parmValues(ListValueContract);

dimStorage = DimensionServiceProvider::buildDimensionStorageForLedgerAccount(LedgerAccountContract);

dimensionAttributeValueCombination = DimensionAttributeValueCombination::find(dimStorage.save());

info(strfmt("Ledger dimension %1",dimensionAttributeValueCombination.Recid));

}

No comments:

Post a Comment