public static void main(Args _args)
{
str dimMainAcc, dimCostCenter, dimDivision, dimLocation;
CustTable custTable = CustTable::find("SL0008"); // Add the CustAccount value.
DimensionAttributeValueSetStorage davss = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);
int i;
for (i= 1; i <= davss.elements(); i++)
{
//You can add/update dimension values as per the dimension structure in the system.
if (DimensionAttribute::find(davss.getAttributeByIndex(i)).Name == "MainAccount")
{
dimMainAcc = davss.getDisplayValueByIndex(i);
}
if (DimensionAttribute::find(davss.getAttributeByIndex(i)).Name == "CostCenter")
{
dimCostCenter = davss.getDisplayValueByIndex(i);
}
if (DimensionAttribute::find(davss.getAttributeByIndex(i)).Name == "Division")
{
dimDivision = davss.getDisplayValueByIndex(i);
}
if (DimensionAttribute::find(davss.getAttributeByIndex(i)).Name == "Location")
{
dimLocation = davss.getDisplayValueByIndex(i);
}
}
str dimStorageValue = "-" + dimMainAcc + "-" + dimCostCenter + "-" + dimDivision + "-" + dimLocation;
Info(dimStorageValue);
}
{
str dimMainAcc, dimCostCenter, dimDivision, dimLocation;
CustTable custTable = CustTable::find("SL0008"); // Add the CustAccount value.
DimensionAttributeValueSetStorage davss = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);
int i;
for (i= 1; i <= davss.elements(); i++)
{
//You can add/update dimension values as per the dimension structure in the system.
if (DimensionAttribute::find(davss.getAttributeByIndex(i)).Name == "MainAccount")
{
dimMainAcc = davss.getDisplayValueByIndex(i);
}
if (DimensionAttribute::find(davss.getAttributeByIndex(i)).Name == "CostCenter")
{
dimCostCenter = davss.getDisplayValueByIndex(i);
}
if (DimensionAttribute::find(davss.getAttributeByIndex(i)).Name == "Division")
{
dimDivision = davss.getDisplayValueByIndex(i);
}
if (DimensionAttribute::find(davss.getAttributeByIndex(i)).Name == "Location")
{
dimLocation = davss.getDisplayValueByIndex(i);
}
}
str dimStorageValue = "-" + dimMainAcc + "-" + dimCostCenter + "-" + dimDivision + "-" + dimLocation;
Info(dimStorageValue);
}
No comments:
Post a Comment