zoukankan      html  css  js  c++  java
  • Axapta: Multi tables lookup

     

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

    I had used it on creating a sales line.

    Overwrite lookup method of SalesLine_ItemId on SalesTable Form

    public void lookup()
    {
        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(this,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(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");
        queryBuildDataSource2.addRange(fieldNum(InventTableModule, ModuleType)).value("0");

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

     

    First only need u import class: SysMultiTableLookup. 

    From:http://www.cnblogs.com/JackyXu1981/articles/1338228.html

  • 相关阅读:
    kingbase8d常见问题
    kibana-7.9.1安装
    ElasticSearch-7.9.1
    在线分析-jstack
    Wireshark常用过滤条件
    shiro登录认证过程
    查看mysql库中所有表的大小和记录数
    linux设置定时任务crontab
    POI 使用常见问题
    Java源码之String-构造方法
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2761442.html
Copyright © 2011-2022 走看看