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

  • 相关阅读:
    Vue 之 mixin的用法
    react 初学之 jsx ,prop。state
    前端清除缓存的集中方法
    关于event被废弃后的新实用方法
    JS获取字符串的字节长度
    getPopupContainer解决ant-design-vue select组件下拉框偏移错位
    frameset标签使用
    浏览器内核
    两种多关键字排序代码
    两种多关键字排序策略比较
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2761442.html
Copyright © 2011-2022 走看看