Below is the way to get defaultdimensions of a record. In this example I'm using customer account .
In the same way you can try for other records(sales orders, purchase order etc)
Example 1
------------
DimensionAttributeValueSetStorage dimStorage;
// DimensionDefault is a RecId that combines all Dimension Values
dimStorage = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);
for (i= 1 ; i<= dimStorage.elements() ; i++)
{
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Brand")
{
info(dimStorage.getDisplayValueByIndex(i));
}
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Channel")
{
info(dimStorage.getDisplayValueByIndex(i));
}
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Customer")
{
info(dimStorage.getDisplayValueByIndex(i));
}
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Department")
{
info(dimStorage.getDisplayValueByIndex(i));
}
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "ProductCategory")
{
info(dimStorage.getDisplayValueByIndex(i));
}
}
Example 2
--------------
ProjTable ProjTable;
DimensionAttributeValueSet DimensionAttributeValueSet;
DimensionAttributeValueSetItem DimensionAttributeValueSetItem;
DimensionAttributeValue DimensionAttributeValue;
DimensionAttribute DimensionAttribute;
while select * from ProjTable
where ProjTable.ProjId == "10005" // To display value for ProjectId "10005" only
join RecId from DimensionAttributeValueSet
where DimensionAttributeValueSet.RecId == ProjTable.DefaultDimension
join RecId, DisplayValue from DimensionAttributeValueSetItem
where DimensionAttributeValueSetItem.DimensionAttributeValueSet == DimensionAttributeValueSet.RecId
join RecId from DimensionAttributeValue
where DimensionAttributeValue.RecId == DimensionAttributeValueSetItem.DimensionAttributeValue
join RecId, Name from DimensionAttribute
where DimensionAttribute.RecId == DimensionAttributeValue.DimensionAttribute
{
info(DimensionAttribute.Name+"----"+ DimensionAttributeValueSetItem.DisplayValue);
}
In the same way you can try for other records(sales orders, purchase order etc)
Example 1
------------
DimensionAttributeValueSetStorage dimStorage;
// DimensionDefault is a RecId that combines all Dimension Values
dimStorage = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);
for (i= 1 ; i<= dimStorage.elements() ; i++)
{
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Brand")
{
info(dimStorage.getDisplayValueByIndex(i));
}
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Channel")
{
info(dimStorage.getDisplayValueByIndex(i));
}
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Customer")
{
info(dimStorage.getDisplayValueByIndex(i));
}
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Department")
{
info(dimStorage.getDisplayValueByIndex(i));
}
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "ProductCategory")
{
info(dimStorage.getDisplayValueByIndex(i));
}
}
Example 2
--------------
ProjTable ProjTable;
DimensionAttributeValueSet DimensionAttributeValueSet;
DimensionAttributeValueSetItem DimensionAttributeValueSetItem;
DimensionAttributeValue DimensionAttributeValue;
DimensionAttribute DimensionAttribute;
while select * from ProjTable
where ProjTable.ProjId == "10005" // To display value for ProjectId "10005" only
join RecId from DimensionAttributeValueSet
where DimensionAttributeValueSet.RecId == ProjTable.DefaultDimension
join RecId, DisplayValue from DimensionAttributeValueSetItem
where DimensionAttributeValueSetItem.DimensionAttributeValueSet == DimensionAttributeValueSet.RecId
join RecId from DimensionAttributeValue
where DimensionAttributeValue.RecId == DimensionAttributeValueSetItem.DimensionAttributeValue
join RecId, Name from DimensionAttribute
where DimensionAttribute.RecId == DimensionAttributeValue.DimensionAttribute
{
info(DimensionAttribute.Name+"----"+ DimensionAttributeValueSetItem.DisplayValue);
}
I would recommend my profile is important to me, I invite you to discuss this topic... astrology career report
ReplyDeleteAs a Bankruptcy Lawyer I am always asked; Can I get rid of my Student loan relief in bankruptcy? But over 99% of people with student debt and attorneys don't realize it's possible. Read on to find out how.
ReplyDeleteGreat! It sounds good. Thanks for sharing..
ReplyDeletepożyczka przez internet na konto
wealth management consulting
ReplyDelete