X++ code to display dimension values for a given dimension in D365FO.
Views (97)
Hi,
In this post will provide the code to display the financial dimensions of a given party. For demo purpose chosen a vendor.
Below are the financial dimensions of a vendor:
X code:
class DAX_FinDimensionsDisplay
{
///
/// Runs the class with the specified arguments.
///
/// The specified arguments.
public static void main(Args _args)
{
DimensionAttributeValueSetStorage dimStorage;
str name;
VendTable vendTable;
int i = 1;
select * from vendTable
where vendTable.AccountNum == "1001";
dimStorage = DimensionAttributeValueSetStorage::find(vendTable.DefaultDimension);
while (i<= dimStorage.elements())
{
name = DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name;
info(strFmt("Name: %1, Value: %2", name, dimStorage.getDisplayValueByIndex(i)));
i ;
}
}
}
On executing the above code, dimension values get displayed.
Regards,
Chaitanya Golla

Like
Report
*This post is locked for comments