Axapta: Multi tables Lookup

Source: Internet
Author: User

/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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.