AX2012 在对话框上自定义查找.

DilaogLookup ckass

ckass Deckaration

Here the class declaration, don’t forget to extend RunBase.

class DialogLookup extends RunBase
{}

Methods:

Main

Nothing special here either, just get a new instance from your class, to be able to run it later on.

static void main(Args _args)
{DialogLookup            dialogLookup = new DialogLookup();if (dialogLookup.prompt()){dialogLookup.run();}
}

Our dialog

This is where the fun starts. You simply want to get the control from your field, then you call the registerOverrideMethod(…) and as parameter you provide your class name (in this case, the class we are actually writing here) and the method name (this does not have to be lookup!).

protected Object dialog()
{Dialog                      dialog;FormStringControl           control;DialogField                 fieldLookup;dialog = super();// Dialog Titledialog.caption("Aif Adapter");// Field - EDT, LabelfieldLookup = dialog.addField(extendedTypeStr(AifAdapterName), "AifAdapterName:");// Get controlcontrol = fieldLookup.control();// Override lookup methodcontrol.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(DialogLookup /* Class name */, lookup /* Method name*/), this);return dialog;
}

The custom lookup

In the last step we will just set up a “normal” (don’t forget the FormStringControl!) lookup method.

public void lookup(FormStringControl _control)
{Query                   query = new Query();QueryBuildDataSource    queryBuildDataSource;SysTableLookup          sysTableLookup = SysTableLookup::newParameters(tableNum(AifAdapter), _control);// Create lookup for AifAdapter's Name and AdapterClassIdsysTableLookup.addLookupField(fieldNum(AifAdapter, Name));sysTableLookup.addLookupField(fieldNum(AifAdapter, AdapterClassId));// Setup queryqueryBuildDataSource = query.addDataSource(tableNum(AifAdapter));sysTableLookup.parmQuery(query);// Perform lookupsysTableLookup.performFormLookup();
}

And this is what it looks like:

Just hit F5 and run your class.

The custom lookup provides us the class id. If I recall it right, the standard AX would provide the EDT Type.

Dynamics AX2012 Custom Lookup on a Dialog相关推荐

  1. Dynamics AX2012 AOT同步到VS

    Dynamics AX 2012 AOT同步到VS 因为在AX2012里不能对SSRS报表直接进行开发,需要到 Microsoft Visual Studio 2010里进行SSRS报表的开发. 如何 ...

  2. Dynamics 365 Xrm.Naviagtion.navigateTo 打开Dialog后如何关闭

    Xrm.Naviagtion.navigateTo是新版本中引进得API,具体得介绍可以查看docs,这里就不多讲了,其中用得比较多的的地方九四类似与下图这样的dialog框,之前要实现这个效果得自己 ...

  3. Microsoft Dynamics AX2012 R2吐槽系列(4)

    之四 历经艰辛又搞出来一段代码,在SSMS中测试的时候好好的,结果跑到X++ 中,发现运行结果和运气相关,运气好的时候结果和SSMS中的正确结果一样,运气不好,结果是随机的,结果调查的时候那叫一个费尽 ...

  4. Dynamics AX2012 SSRS errors:For more information about this error navigate...

    最近在做一个SSRS报表的开发遇到的一个报错的问题. 逻辑上是没有写错的.但是等到发布到测试环境的时候会出现错误. For more information about this error navi ...

  5. 【转】Dynamics 365 CRM 开发架构简介

    目录 概览 名词解释 连接到Dynamics 365 CRM Web API Organization service 选择 - Web API vs. Organization service 扩展 ...

  6. Dynamics 365 CRM 开发架构简介

    目录 概览 名词解释 连接到Dynamics 365 CRM Web API Organization service 选择 - Web API vs. Organization service 扩展 ...

  7. 浅谈android中的自定义封装易用的Dialog

    转载地址:http://blog.csdn.net/u013064109/article/details/51990526 好久没写Android的博客,最近在做一个android的项目,里面用到我们 ...

  8. Flutter 入门指北(Part 9)之弹窗和提示(SnackBar、BottomSheet、Dialog)

    该文已授权公众号 「码个蛋」,转载请指明出处 前面的小节把常用的一些部件都介绍了,这节介绍下 Flutter 中的一些操作提示.Flutter 中的操作提示主要有这么几种 SnackBar.Botto ...

  9. android phonegap插件开发方法 plugin

    2019独角兽企业重金招聘Python工程师标准>>> android phonegap插件开发方法 plugin 分类: phonegap 2014-03-03 22:41  59 ...

最新文章

  1. 独家 | 我们扒出了这家中国创业公司,竟比苹果iPhone X早两年推出黑科技,还不用借助深度摄像头
  2. 常用方法 Excel转换为DataSet
  3. asp.net各种类型视频播放代码(全)(转)
  4. 怎样修改SSIS包中 Connection Manager 中的参数
  5. C语言—静态存储与动态存储
  6. php升级的痛苦,升级 PHP 7.4 带来的两个大坑
  7. 《怪物猎人》战斗核心设计分析
  8. 基于matlab/simulink的双电机速度跟踪伺服系统仿真,基于MatlabSimulink的伺服系统仿真pdf.doc...
  9. C语言中extern修饰符的用法
  10. python模块的函数_python模块内置函数
  11. 17.3.10--C语言运行的步骤
  12. 《Android 面试指南》来自腾讯、阿里巴巴、欢聚时代、美团、聚美优品、悦跑圈等大佬分享的面经...
  13. 计算机辅助教学研究现状,国内计算机辅助口译教学研究的现状与思考.docx
  14. 论文笔记_S2D.45_DeepVO: 基于深度循环卷积神经网络的端到端视觉里程计
  15. 计算机网络连接设备不见了,怎么办电脑网络连接不见了
  16. 犀牛系统连接服务器失败,犀牛5.0安装运行失败,Rhino安装失败解决方法
  17. centos设置root免密自动登陆
  18. CS229 Lecture 10
  19. Ubuntu18.04 运行velodyne
  20. Mac 解压rar格式文件(附解压工具包)

热门文章

  1. python提供了3个常用的读文件函数、分别是,Python3 对文件操作
  2. 苹果手机录屏在哪里_小米,苹果录屏哪个好?独家整理手机录屏方法,那你知道哪几种?...
  3. 如何通过将照片从 Mac 移动到 iCloud 来节省空间
  4. 袋式过滤器原理及优点
  5. 关于膝盖护具的使用和选择
  6. k8s免费在线集群工具
  7. mapbox-gl自定义图层雷达扫描效果(视频)
  8. ubuntu20通过nfs挂载根文件系统失败:VFS: Unable to mount root fs via NFS, trying floppy.
  9. 移动端内webview页面调试技巧
  10. 辽宁省推动发展低碳运输全面构建综合物流网站