Hi all ,
In my last post we used the names of financial dimensions in order to get the values from Customer Master.
In this post we will see how this can be achieved by using the name of the Accounting Structure configured to be used by the customer master.
Let's see how do we do it :-
class CalculateFinancialDimensionWActStruct
{
public Str1260 calculatefinancialdim(CustTable _custtable)
{
List dimensionAttributeList;
ListEnumerator listEnumerator;
DimensionAttributeSetItem dimAttrSetItem;
DimensionAttribute dimAttr;
DimensionEnumeration dimensionSetId;
DimensionService dimensionService;
DimensionContract dimensionContract;
AccountStructureContract accountStructureContract;
Str1260 dimvalue ;
DefaultDimensionView defaultDimensionViewitem;
dimensionSetId = DimensionCache::getDimensionAttributeSetForLedger();
dimensionService = new dimensionService();
accountStructureContract = new AccountStructureContract();
accountStructureContract.parmName("RevenueDim");
dimensionAttributeList = dimensionService.getDimensions(accountStructureContract);
listEnumerator = dimensionAttributeList.getEnumerator();
while (listEnumerator.moveNext())
{
dimensionContract = listEnumerator.current();
select dimAttr
join RecId from dimAttrSetItem
where dimAttrSetItem.DimensionAttribute == dimAttr.RecId &&
dimAttrSetItem.DimensionAttributeSet == dimensionSetId
&& dimAttr.Name==dimensionContract.parmDimensionName();
select firstonly defaultDimensionViewitem
where defaultDimensionViewitem.DefaultDimension == _custtable.DefaultDimension
&& defaultDimensionViewitem.Name ==dimAttr.Name;
if (defaultDimensionViewitem.RecId)
{
dimvalue += '-'+defaultDimensionViewitem.DisplayValue ;
}
else
{
dimvalue += '-' ;
}
defaultDimensionViewitem.clear();
}
return dimvalue;
}
Happy Coding !!!
Thanks for sharing the valuable information. Keep on sharing
ReplyDeleteD365 Finance and Operations Training
D365 Finance and Operations Online Training
D365 Finance and Operations Training in Hyderabad
D365 Finance Training
D365 Operations Training
Welcome to the party of my life here you will learn everything about me. uniccshop
ReplyDeleteV. M. Rodionova makes an emphasize of finances, as dispersing relations when D. S. Moliakov underlines modern establishment of finances.Blake Mortgage
ReplyDeleteAs the cycle proceeds, and in complex utilization of financial administrations along the financial administrations esteem chain, they should save anyway for different ventures later. Comparable or much more certain connection is noticed if the mode of access and utilization is through imaginative innovation. https://europa-road.eu/
ReplyDelete