/Files/jackyxu1981/sysmultitablelookup.rarSysmultitablelookup class download
The sysmultitablelookup.rar is a class to show multi table information.
When you want to create a sales line in so, you can selet an item and see some information of item. Those information is from invent table.
But sometimes you want those information from multi tables, how to do?
Sysmultitablelookup class provide a solution to it.
It is fromHttp://kashperuk.blogspot.com/
I had used it on creating a sales line.
Overwrite lookup methodSalesline_itemidOn salestable form
Public void Lookup ()
{
Query query = new query ();
Querybuilddatasource, querybuildperformance2;
Querybuildrange;
Sysmultitablelookup extends ablelookup; // not extends ablelookup class
;
Querybuilddatasource = query. adddatasource (tablenum (inventtable); // link a another table
Querybuildperformance2 = querybuilddatasource. adddatasource (tablenum (inventtablemodule ));
Querybuildperformance2.joinmode (joinmode: innerjoin );
Querybuildperformance2.relations (true );
Export ablelookup = sysmultitablelookup: newparameters (this, query );
systablelookup. addlookupfield (fieldnum (inventtable, Itemid);
using ablelookup. addlookupfield (fieldnum (inventtable, itemname);
using ablelookup. addlookupfield (fieldnum (inventtable, namealias);
using ablelookup. addlookupfield (fieldnum (inventtable, itemgroupid);
systablelookup. addlookupfield (fieldnum (inventtable, itemtype);
using ablelookup. addlookupfield (fieldnum (inventtable, hdsh_itemoriginname);
systablelookup. addlookupfield (fieldnum (inventtable, hdsh_previtemid);
systablelookup. addlookupfield (fieldnum (inventtablemodule, unitid), 2); // get a field from another table. 2 is second datasource
Querybuilddatasource. addrange (fieldnum (inventtable, hdsh_visible). Value ("0 ");
Querybuildperformance2.addrange (fieldnum (inventtablemodule, moduletype). Value ("0 ");
Systablelookup. parmquery (query );
Using ablelookup. Using mformlookup ();
}
First only need u import class: sysmultitablelookup.
From: http://www.cnblogs.com/JackyXu1981/articles/1338228.html