föstudagur, 14. október 2011

Find record in grid (similar to F4 in XAL)

User asked for a way to find a record in grid without filtering out other records.

Method FindRecord() used.

A button added to the form.  Following code added to the clicked method of the button:

    searchFields = new dialog("Leitargluggi");
    dlgFldVendAccount = searchFields.addField(typeId(VendAccount));
    searchFields.run();


    vend = dlgFldVendAccount.value();
   
    if(vend > '')
    {
        select firstonly mjt where mjt.JournalId == MPSJournalTrans.JournalId
                   &&    mjt.vendAccount == vend;
        if (mjt.RecId)
        {
            MPSJournalTrans_ds.findRecord(mjt);
        }
    }