lookup on referenceGroupControl doesn't work

public void init()

{

    next init();

    FormReferenceGroupControl formReferenceGroupControlForInvoice;

    formReferenceGroupControlForInvoice = this.control(this.controlId(formControlStr(InventTransferOrders, VendInvoiceJourGroupControl))) as FormReferenceGroupControl;
    formReferenceGroupControlForInvoice.registerOverrideMethod(methodStr(FormReferenceGroupControl, lookup),methodStr(InventTransferOrders_Extension, checkInvoice),this);

}

public void checkInvoice(FormReferenceGroupControl _formControl)
{
    Query query = new Query();
    QueryBuildDataSource queryBuildDataSource;
    QueryBuildRange queryBuildRange;
    SysTableLookup sysTableLookup;
    
    sysTableLookup = SysTableLookup::newParameters(tablenum(VendInvoiceJour), _formControl, true);
    
    sysTableLookup.addLookupfield(fieldnum(VendInvoiceJour, InvoiceId));
    sysTableLookup.addLookupfield(fieldNum(VendInvoiceJour, DueDate));
    sysTableLookup.addLookupfield(fieldNum(VendInvoiceJour, Payment));
    sysTableLookup.addLookupfield(fieldNum(VendInvoiceJour, CurrencyCode));
    
    queryBuildDataSource = query.addDataSource(tablenum(VendInvoiceJour));
    queryBuildRange = queryBuildDataSource.addRange(fieldnum(VendInvoiceJour, InvoiceAccount));
    queryBuildRange.value(queryValue(InventTransferTable.VendAccount));
    
    
    sysTableLookup.parmQuery(query);
    
    sysTableLookup.performFormLookup();
}

I want to do a lookup on referencegroupcontrol, i wrote this code to achieve that. Somone can explain what's  wrong?

thanks in advance.

Parents
No Data
Reply
  • Your code is looks like something you would use with StringEdit controls, for instance, not with reference groups.

    In your case, override lookupReference() method instead of lookup() and use SysReferenceTableLookup instead of SysTableLookup. Now when you know the keywords, you can also find example in the standard application and/or on internet.

Children
No Data
Related
Recommended