If you need to show on your form standard financial dimension control like that

then you can follow this step by step guide How add financial dimension on forms inside Ax2012
Just skip first point because SalesTable
already has DefaultDimension
field.
But if you need to find record in General ledger > Setup > Organization > Business units then you can use this piece of code
DimensionAttributeValueSetStorage dimStorage;
DimensionValue dimensionValue;
DimensionDefault defaultDimension;
int i;
;
defaultDimension = SalesTable.DefaultDimension;
dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension);
for (i = 1; i <= dimStorage.elements(); i++)
{
if (DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == 'BusinessUnit')
{
dimensionValue = dimStorage.getDisplayValueByIndex(i);
break;
}
}
dimensionValue
holds Operation unit number
and using this value you can find record in Business units (OMOperatingUnit
) table.