For achieving this I have created a Job in which I have three methods, which I have call in my main method.
Main() Method:
Source Code Explanation:
- Set main account (in my case '61170005').
- Set default dimension (in my case '68719489575').
- Pass it into CombineMainAccoutAndDefaultDimension() method.
Source Code Explanation:
- Get dimension cache.
- Iterate dimension attribute Set Item to get dimension attribute except main account.
- Return dimension attributes container.
GetDimensionAttributeValue() Method:
Source Code Explanation:
- Find dimension attribute value set storage through default dimension.
- Get display value by dimension attribute from dimension storage.
CombineMainAccoutAndDefaultDimension() Method:
Source Code Explanation:
- Initialize and declare objects.
- Get container which holds dimension attributes. (Get from previous getDimensionAttriuteName() method).
- Iterate dimension attributes and get its values. (Get dimension values from previous getDimensionAttributeValue() method).
- Pass attribute name and value in dimension attribute value contract.
- Pass main account and value contract object in ledger account contract class.
- Through dimension service provider get dimension storage.
- Get dimension value combination of main account and default dimension.
- Return value combination record id which is Ledger Dimension.
Result:
This example is taken from this Microsoft community post Combine main account with default dimension to ledger dimension
No comments:
Post a Comment