Berikut ini digunakan untuk membuat lookup sendiri. Kasusnya, nambah form dan EditString, namun tidak ada relasi ke datasource (EdiString lepasan gitu.....)
public void lookup()
{
//super();
//Inisialisasi sysTableLookupClass
sysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventItemgroup), this);
Query query = New Query();
QueryBuildDataSource qbdsTbl1, qbdsTbl2;
QueryBuildRange qbr;
;
//Tambah tabel
qbdsTbl1 = query.addDataSource(tableNum(InventItemgroup));
//Tambah rentang Query untuk membatasi daftar record
qbr = qbdsTbl1.addRange(fieldNum(InventItemgroup,ItemGroupId));
qbr.value();
qbr = qbdsTbl1.addRange(fieldNum(InventItemgroup,Name));
qbr.value();
qbdsTbl1.relations(true);
sysTableLookup.addLookupfield(fieldNum(InventItemgroup, ItemGroupId));
sysTableLookup.addLookupfield(fieldNum(InventItemgroup, Name));
sysTableLookup.parmQuery(query);
//Tampilkan drop down
sysTableLookup.performFormLookup();
}
No comments:
Post a Comment