web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Financial dimension sets values lookup X++

Muhammad Uzair Shah Profile Picture Muhammad Uzair Shah 201

Hi guys,

In this blog, I will explain how to create Financial dimension sets values lookup.

Requirement:

I came across a requirement where in Financial dimension sets values lookup were required on the dialog form and General ledger balances for Main accounts with Financial dimensions calculated based on the Financial dimension set values selected on the dialog form just like calculation on General ledger trial balance form.

Solution:

Create an extended class that handles the logic of loading Financial dimension sets values on dialog control lookup.

Extend the class with SysLookup class to reuse SysTableLookup methods for generating lookup from the SysLookup class.

class FinDimSetValuesLookup extends SysLookup
{
    /// 
    /// This method is used to load Financial dimension sets values on dialog control lookup
    /// 
    public void dimensionHierarchyLookup(FormControl _formControl)
    {
        Query query;
        SysTableLookup sysTableLookup;
        QueryBuildRange queryBuildRange;
        QueryBuildDataSource qbds;
        query = new Query();
        qbds = query.addDataSource(tableNum(DimensionHierarchy));
        // Filter dimension hierarchy to only show focuses that are not deleted.
        queryBuildRange = qbds.addRange(fieldnum(DimensionHierarchy, StructureType));
        queryBuildRange.value(queryValue(DimensionHierarchyType::Focus));
        queryBuildRange.status(RangeStatus::Hidden);
        queryBuildRange = qbds.addRange(fieldnum(DimensionHierarchy, DeletedVersion));
        queryBuildRange.value(queryValue(0));
        queryBuildRange.status(RangeStatus::Hidden);
        sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionHierarchy), _formControl, true);
        sysTableLookup.addLookupfield(fieldNum(DimensionHierarchy, Name));
        sysTableLookup.parmQuery(query);
        sysTableLookup.performFormLookup();
    }
}

Comments

*This post is locked for comments