RE: Validate Dimension Value with Account Structure
Hello Vairam,
For this there are 2 ways, either from AX or by code:
1- By code you might use this sample code (i can't share the full code here because too long):
ledgerAccountContract.parmValues(listValueContract);
dimStorage = DimensionServiceProvider::buildDimensionStorageForLedgerAccount(LedgerAccountContract);
dimensionAttributeValueCombination = DimensionAttributeValueCombination::find(dimStorage.save());
ledgerDimension = dimensionAttributeValueCombination.RecId;
dimStorage = DimensionServiceProvider::buildDimensionStorageForLedgerAccount(ledgerAccountContract);
dimensionValidationStatus = DimensionValidation::validateByTreeForCombination(dimStorage,dateNull(),true,true);
2- You can create a new PO and add an item to the lines. Then go to Line details > Financial dimension tab. Here you can insert the combination you want, and then click on Financials > Distribute amounts : if the combination is not valid you will see red box in the line. You can change the Main account from Item group > Purchase order > Purchase expenditure for product , and then Reset the validation from Distribute amounts.
Make sure to reset the correct setup if you change it.
Thank you,