zoukankan      html  css  js  c++  java
  • SysMultiTableLookup class

    https://files.cnblogs.com/Jimmyx/Class_SysMultiTableLookup.rar

    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 from http://kashperuk.blogspot.com/

    I had used it on creating a sales line.

    Overwrite lookup method of SalesLine_ItemId on SalesTable Form

    commont lookup method in tables

     

    // <GBR>
    public client static void lookupByInventLocationType_BR(FormStringControl ctrl, InventLocationType _inventLocationType)
    {
        SysTableLookup       sysTableLookup = SysTableLookup::newParameters(tablenum(InventLocation), ctrl);
        Query                query = new Query();
        QueryBuildDataSource queryBuildDataSource;
        ;

        sysTableLookup.addLookupfield(fieldnum(InventLocation, InventLocationId));
        sysTableLookup.addLookupfield(fieldnum(InventLocation, Name));
        sysTableLookup.addLookupfield(fieldnum(InventLocation, InventSiteId));

        queryBuildDataSource = query.addDataSource(tablenum(InventLocation));
        queryBuildDataSource.addRange(fieldnum(InventLocation, InventLocationType)).value(queryValue(_inventLocationType));

        sysTableLookup.parmQuery(query);
        sysTableLookup.performFormLookup();
    }

    // </GBR>

    Lookup method on the salesLine Form
    public void lookup(FormControl _formControl, str _filterStr)
    {
    Query query
    = new Query();
    QueryBuildDataSource queryBuildDataSource,queryBuildDataSource2 ;
    QueryBuildRange queryBuildRange;
    SysMultiTableLookup sysTableLookup ;
    //Not SysTableLookup class
    ;


    queryBuildDataSource
    = query.addDataSource(tableNum(InventTable)); //link a another table
    queryBuildDataSource2 = queryBuildDataSource.addDataSource(tablenum(InventTableModule));
    queryBuildDataSource2.joinMode(JoinMode::InnerJoin) ;
    queryBuildDataSource2.relations(
    true) ;

    sysTableLookup
    = SysMultiTableLookup::newParameters(_formControl,query) ;

    sysTableLookup.addLookupField(fieldNum(InventTable, ItemId));
    sysTableLookup.addLookupField(fieldNum(InventTable, ItemName));
    sysTableLookup.addLookupField(fieldNum(InventTable, NameAlias));
    sysTableLookup.addLookupfield(fieldNum(InventTable, ItemGroupId));
    sysTableLookup.addLookupfield(fieldNum(InventTable, ItemType));
    sysTableLookup.addLookupField(fieldNum(InventTableModule,price),
    2) ;
    sysTableLookup.addLookupField(fieldNum(InventTableModule,UnitId),
    2) ; // get a field from another table. 2 is second datasource


    queryBuildDataSource2.addRange(fieldNum(InventTableModule, ModuleType)).value(
    "0");

    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
    // super(_formControl, _filterStr);
    }
  • 相关阅读:
    [adminitrative][archlinux][setfont] 设置console的字体大小
    [daily][archlinux][rsync] rsync
    [skill][msgpack] 初试msgpack库以及基本使用
    AWS之搭建深度学习主机
    AWS之SSH登录:使用 PuTTY 从 Windows 连接到 Linux 实例
    加拿大大学排名 by USNews
    Python多进程vs多线程
    Python之JSON使用
    Python之模块与包
    Android重打包+重新签名工具Apktool Box
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1896965.html
Copyright © 2011-2022 走看看