Custom Lookup based on 2 fields value

Hi,

I am trying to create a lookup based on 2 fields, not sure if this would work. Please let me know any other way possible. Thanks.

    public void lookup()
    {
        Query query = new Query();
        QueryBuildDataSource queryBuildDataSource;
        QueryBuildRange queryBuildRange; 
    
        SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(custTable), this); 
    
        sysTableLookup.addLookupField(fieldNum(CustTable, AccountNum));
        sysTableLookup.addLookupField(fieldNum(CustTable, CustGroup)); 
    
        queryBuildDataSource = query.addDataSource(tableNum(CustTable));
    
        queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, CustGroup));
        queryBuildRange.value('40');
        queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, Field2));
        queryBuildRange.value('SomeValue');
        
        sysTableLookup.parmQuery(query);
    
        sysTableLookup.performFormLookup();
    
        //super();
    }

Related
Recommended