project rar:http://files.cnblogs.com/files/sxypeace/PrivateProject_MutilTableLookupOnCtronl.rar

在AX 中控件的looup方法需要展示多表数据的时候,需要新建一个lookupFrom ,或者将所有数据写入临时表才能达到目的。

翻看了一下Class\sysTableLook,发现其实是动态创建form添加数据源显示控件来实现的。

于是new了一个新的Class\sysViewLook,来实现多表lookup。

public void lookup()
{ SysViewLookup SysViewLookup = new SysViewLookup();
query query = new query();
queryBuildDatasource qbds1;
queryBuildDatasource qbds2;
queryBuildDatasource qbds3;
; //must add by desc sorting
SysViewLookup.parmAddLookupTableId( tableNum(InventDim));
SysViewLookup.parmAddLookupTableId( tableNum(SalesLine));
SysViewLookup.parmAddLookupTableId( tableNum(SalesTable)); qbds1 = query.addDataSource(tableNum(SalesTable));
qbds2 = qbds1.addDataSource(tablenum(salesLine));
qbds2.relations( true);
qbds3 = qbds2.addDataSource(tableNum(InventDim));
qbds3.relations(true); sysQuery::findOrCreateRange( qbds2, fieldNum(salesLine,ItemId)).value("22MA*00K");
qbds1.addSortField( fieldNum(SalesTable,CreatedDate),SortOrder::Descending);
qbds1.addSortField( fieldNum(SalesTable,SalesId),SortOrder::Descending);
qbds1.addSortField( fieldNum(SalesTable,CustAccount),SortOrder::Ascending);
qbds2.addSortField( fieldNum(SalesLine,ItemId),SortOrder::Ascending);
qbds2.addSortField( fieldNum(InventDim,InventSizeId),SortOrder::Ascending); SysViewLookup.parmCallingControl( this);
SysViewLookup.addLookupfield( TableNum(salesTable), fieldNum(SalesTable,CreatedDate));
SysViewLookup.addLookupfield( TableNum(salesTable), fieldNum(SalesTable,SalesId),true);
SysViewLookup.addLookupfield( TableNum(salesTable), fieldNum(SalesTable,CustAccount));
SysViewLookup.addLookupfield( TableNum(SalesLine), fieldNum(SalesLine,ItemId));
SysViewLookup.addLookupfield( TableNum(InventDim), fieldNum(InventDim,InventSizeId)); SysViewLookup.parmQuery( query);
SysViewLookup.performFormLookup();
}

附完整代码的下载地址 http://files.cnblogs.com/files/sxypeace/PrivateProject_MutilTableLookupOnCtronl.rar

Dynamics AX 4.0 多表looup的更多相关文章

  1. Dynamics AX Hostory

    现在谈起Dynamics AX,在微软Dynamics系列产品当中,作为最受瞩目和最有前景的Dynamics套装产品线,很多人也许只知道它曾经由于资本市场的上市和并购,前后经历了三个“东家”.对于它长 ...

  2. [转]Dynamics AX and Generic collections of .Net

    转自:http://blogs.msdn.com/b/emeadaxsupport/archive/2009/04/23/dynamics-ax-and-generic-collections-of- ...

  3. 转:Microsoft Dynamics AX内部版本号概述

    Overview of Microsoft Dynamics AX build numbers 转自:https://community.dynamics.com/ax/b/axsupport/arc ...

  4. Dynamics AX 2012 的工业物联网解决方案

    Dynamics AX 2012 的工业物联网解决方案 物联网 物联网的概念在这两年非常火,包括近期很火的共享单车初创公司--摩拜单车,在产品中运用了Azure Iot物联网技术.但是,物联网并不是一 ...

  5. Dynamics AX 2012 在BI分析中建立数据仓库的必要性

    AX系统已有的BI分析架构 对于AX 的BI分析架构,相信大家都了解,可以看Reinhard之前的译文[译]Dynamics AX 2012 R2 BI系列-分析的架构 . AX 的BI分析架构的优势 ...

  6. Dynamics AX 2012 R2 如何处理运行时间较长的报表

    当处理的数据量较多,逻辑比较复杂时,报表可能会超时.为了解决这个问题,Reinhard一直使用SrsReportDataProviderPreProcess来做预处理报表.它会在调用SSRS前,在AX ...

  7. 一、Microsoft Dynamics CRM 4.0 SDK概述

    Chapter 1. Microsoft Dynamics CRM 4.0 SDK Overview(SDK概述) You are probably reading this book because ...

  8. Dynamics AX 中的图片处理

    1.从本地读取图片文件,并判断格式是否附合要求. FilenameFilter filter = [‘Image Files‘,‘*.bmp;*.jpg;*.gif;*.jpeg‘]; BinData ...

  9. Dynamics AX 2012 性能优化之 SQL Server 复制

    Dynamics AX 2012 性能优化之 SQL Server 复制 分析数据滞后 在博文 Dynamics AX 2012 在BI分析中建立数据仓库的必要性 里,Reinhard 阐述了在 AX ...

随机推荐

  1. 在C#中子线程如何操作主线程中窗体上控件

    在C#中,直接在子线程中对窗体上的控件操作是会出现异常,这是由于子线程和运行窗体的线程是不同的空间,因此想要在子线程来操作窗体上的控件,是不可能 简单的通过控件对象名来操作,但不是说不能进行操作,微软 ...

  2. Hadoop 2.6.0集群搭建

    yum install gcc yum install gcc-c++ yum install make yum install autoconfautomake libtool cmake yum ...

  3. Npoi导出xlsx

    xlsx文件可以超出,excel2003行数限制.必要的dll文件. public void Export() { string filename = Request["searchStri ...

  4. 关于Rotation和Quaternion的一些问题

    当我们使用unity的时候,面对一个物体,一个不可避免的问题就是:控制物体的旋转. unity的Transform组件的第二个属性Rotation为我们提供控制物体旋转的功能.在一个物体的Inspec ...

  5. bug_ _ android.view.WindowManager$BadTokenException: Unable to add window -- token

    ========4       关于android的一个常见错误:Unable to add window --token is not valid android.view.WindowManage ...

  6. LNMP环境搭建配置memcache

    原始出处  http://iceeggplant.blog.51cto.com/1446843/819576 memcached是高性能的,分布式的内存对象缓存系统,在动态应用中减少数据库负载,提升访 ...

  7. springmvc对请求执行流程

    doService-->getHandlerMapping-->handlerMapping-->getHandler-->HandlerExecutionChain--> ...

  8. shell export

    export命令将使系统在创建每一个新的shell时定义这个变量的一个拷贝.这个过程称之为变量输出. 在脚本中export,跟在终端export原理一样. 他们都是一个子shell. http://b ...

  9. 在eclipse中查找指定文件

    1.ctrl+h打开搜索界面 File Search: containing text填*,File name patterns填写hello.*,可以找到hello为命名的文件 知道文件类型,查找里 ...

  10. Delphi Socket 阻塞线程下为什么不触发OnRead和OnWrite事件

    //**********************************************************************************//说明: 阻塞线程下为什么不触 ...