OK ievgen,
I am writing the below code in the Sumbudgettmpbalance method
like this.
select generalJournalAccountEntry
where generalJournalAccountEntry.LedgerAccount == budgetTmpBalance.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;
if(segmentName == 'MainAccount')
{
mainAccount = segment.parmDisplayValue();
mainAccountName = segment.getName();
}
if(segmentName == 'BusinessUnit')
{
businessUnit = segment.parmDisplayValue();
businessUnitName = segment.getName();
}
if(segmentName == 'Department')
{
department = segment.parmDisplayValue();
departmentName = segment.getName();
}
if(segmentName == 'Worker')
{
worker = segment.parmDisplayValue();
workerName = segment.getName();
}
first i am write the select query
select generalJournalAccountEntry
where generalJournalAccountEntry.LedgerAccount == budgetTmpBalance.DimensionFocus;
to map the current dimension focus to the general journal account entry ledger account.
but this relation is not working.
you have any other idea to solve this?