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);
    }
  • 相关阅读:
    Python 之 编程中常见错误
    Python 列表(数组)初识
    Python 字符串处理
    QT学习笔记三 窗口类型
    C++ Primer第五版学习笔记十 引用与指针
    C++ Primer第五版学习笔记九 变量及初始化,声明和定义,作用域
    angularf封装echarts
    记录npm yarn安装遇到的问题
    网页中嵌入google地图
    og协议-有利于SNS网站分享
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1896965.html
Copyright © 2011-2022 走看看