Hi Andre,
First i am try this above scenario, but i am unable to pass the Current dimension focus in to general journal account entry table Ledger account..
That's why i am choose this way..
Please check my code..
In this i am unable to find out a realtion for generaljournalAccountEntry and dimension focus of the budget tmp balance table
select generalJournalAccountEntry
where generalJournalAccountEntry.LedgerAccount == this.DimensionFocus;//"2221100-00000021-00000101-00000027";
//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;
}
}
}