Dynamics AX 4.0 多表looup
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的更多相关文章
- Dynamics AX Hostory
现在谈起Dynamics AX,在微软Dynamics系列产品当中,作为最受瞩目和最有前景的Dynamics套装产品线,很多人也许只知道它曾经由于资本市场的上市和并购,前后经历了三个“东家”.对于它长 ...
- [转]Dynamics AX and Generic collections of .Net
转自:http://blogs.msdn.com/b/emeadaxsupport/archive/2009/04/23/dynamics-ax-and-generic-collections-of- ...
- 转:Microsoft Dynamics AX内部版本号概述
Overview of Microsoft Dynamics AX build numbers 转自:https://community.dynamics.com/ax/b/axsupport/arc ...
- Dynamics AX 2012 的工业物联网解决方案
Dynamics AX 2012 的工业物联网解决方案 物联网 物联网的概念在这两年非常火,包括近期很火的共享单车初创公司--摩拜单车,在产品中运用了Azure Iot物联网技术.但是,物联网并不是一 ...
- Dynamics AX 2012 在BI分析中建立数据仓库的必要性
AX系统已有的BI分析架构 对于AX 的BI分析架构,相信大家都了解,可以看Reinhard之前的译文[译]Dynamics AX 2012 R2 BI系列-分析的架构 . AX 的BI分析架构的优势 ...
- Dynamics AX 2012 R2 如何处理运行时间较长的报表
当处理的数据量较多,逻辑比较复杂时,报表可能会超时.为了解决这个问题,Reinhard一直使用SrsReportDataProviderPreProcess来做预处理报表.它会在调用SSRS前,在AX ...
- 一、Microsoft Dynamics CRM 4.0 SDK概述
Chapter 1. Microsoft Dynamics CRM 4.0 SDK Overview(SDK概述) You are probably reading this book because ...
- Dynamics AX 中的图片处理
1.从本地读取图片文件,并判断格式是否附合要求. FilenameFilter filter = [‘Image Files‘,‘*.bmp;*.jpg;*.gif;*.jpeg‘]; BinData ...
- Dynamics AX 2012 性能优化之 SQL Server 复制
Dynamics AX 2012 性能优化之 SQL Server 复制 分析数据滞后 在博文 Dynamics AX 2012 在BI分析中建立数据仓库的必要性 里,Reinhard 阐述了在 AX ...
随机推荐
- UCOS-消息邮箱(学习笔记)
任务间数据传递通过缓冲区进行,如果将缓冲区赋值给时间控制块成员:指针OSEventPtr,且任务控制块类型为OS_EVENT_TYPE_MBOS则即为消息邮箱: 一创建消息邮箱:OS_EVENT *O ...
- ASP 发送邮件
ASP发送邮件源码 ASP通过调用API接口发送邮件 <% ' '网吧数据 'www.zgw8.com '邮件发送接口调用demo ' ' '获取网页源代码函数 '=============== ...
- FS4412系统移植
一.SD启动盘制作 1. 下载SD启动盘的工具 sdfuse_q 2. 插入SD卡,并格式化 (1)查看SD卡:sudo fdisk -l (2)格式化SD卡: sudo mkfs -t vfat / ...
- ZOJ 3042 City Selection II 【序】【离散化】【数学】
题意: 输入数据n,m.n代表工厂的数量,m代表城市的数量. 接下来n+m行为工厂和城市的坐标. 规定如图所示方向刮风,工厂的air会污染风向地区的air. 注意,工厂和城市的坐标表示的是从x到x+1 ...
- POJ 3264-Balanced Lineup, NYOJ 119-士兵杀敌3 线段树
士兵杀敌(三) 时间限制:2000 ms | 内存限制:65535 KB 难度:5 描述 南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比 ...
- select into from 和 insert into select 的用法和区别
select into from 和 insert into select都是用来复制表,两者的主要区别为: select into from 要求目标表不存在,因为在插入时会自动创建.insert ...
- php 判断数组是否为空的几种方法
php数组为空我们可以通过很多php自带函数来实现了,比如count函数,empty函数等都可以判断数组是否为空,下面小编就为各位整理了不少的判断数组是否为空的函数,希望对各位会带来帮助. PHP判断 ...
- jQuery基础---filter()和find()
这是jQuery里常用的2个方法.他们2者功能是完全不同的,而初学者往往会被误导. 首先 我们看.find()方法:现在有一个页面,里面HTML代码为;程序代码 <div class=" ...
- Ubuntu - Grub2.0修改默认启动项
1. 我的环境: Ubuntu 10.04 2. 关键位置和文件: /boot/grub/grub.cfg 文件: /etc/grub.d/ 目录: /etc/default/grub 文件: ...
- spark-sql启动后在监控页面中显示的Application Name为SparkSQL::xxxx的疑问
启动spark-sql执行sql时,在监控页面中看到该Application的Name是SparkSQL:hadoop000(其中hadoop000是测试机器的hostname),就有个想法,修改下该 ...