Hi Martin,
Please find the below code i am writing in the Budget tmp balance table insert method.
for getting the Description of the Dimension Values
select generalJournalAccountEntry
where generalJournalAccountEntry.LedgerAccount == this.DimensionFocus;
//Fetch the Value combination record
dimensionAttributeValueCombination = DimensionAttributeValueCombination::find(generalJournalAccountEntry.LedgerDimension);
// Get dimension storage
dimensionStorage = DimensionStorage::findById(generalJournalAccountEntry.LedgerDimension);
if (dimensionStorage == null)
{
throw error("@SYS83964");
}
// Get hierarchy count
hierarchyCount = dimensionStorage.hierarchyCount();
//Loop through hierarchies to get individual segments
for(hierarchyIndex = 1; hierarchyIndex <= hierarchyCount; hierarchyIndex++)
{
//Get segment count for hierarchy
segmentCount = dimensionStorage.segmentCountForHierarchy(hierarchyIndex);
//Loop through segments and display required values
for (segmentIndex = 1; segmentIndex <= segmentCount; segmentIndex++)
{
// Get segment
segment = dimensionStorage.getSegmentForHierarchy(hierarchyIndex, segmentIndex);
// Get the segment information
if (segment.parmDimensionAttributeValueId() != 0)
{
// Get segment name
segmentName = DimensionAttribute::find(DimensionAttributeValue::find(segment.parmDimensionAttributeValueId()).DimensionAttribute).Name;
//Get segment value (id of the dimension)
segmentValue = segment.parmDisplayValue();
//Get segment value name (Description for dimension)
if(segmentName == 'MainAccount')
{
MainAccountDescription = segment.getName();
}
if(segmentName == 'BusinessUnit')
{
BusinessUnitDescription = segment.getName();
}
if(segmentName == 'Zone')
{
ZoneDescription = segment.getName();
}
if(segmentName == 'Department')
{
DepartmentDescription = segment.getName();
}
this.SG_Name = MainAccountDescription + ' -' + BusinessUnitDescription + ' -' + ZoneDescription + ' -' + DepartmentDescription;
}
}
}
But i am unable to find out the relation between the General Journal Account Entry and Budget tmp balance.
I am just wondering why this select query is not working.
I am Just Finding in another way like take the ledger dimension from the ledger account and get the description.