首页 微软AX培训——Information exchange

微软AX培训——Information exchange

举报
开通vip

微软AX培训——Information exchange微软AX培训——Information exchange Lesson 1 Information exchange At the end of this lesson, you are expected to be able to: Know how application elements can activate one another Know how information can be exchanged between application elements Have an overview o...

微软AX培训——Information exchange
微软AX培训——Information exchange Lesson 1 Information exchange At the end of this lesson, you are expected to be able to: Know how application elements can activate one another Know how information can be exchanged between application elements Have an overview of the methods of the Args class. AX-300-ILT-049-v01.00-ENUS Information exchange2 1.1USING INFORMATION EXCHANGE So far you have seen how data is synchronized when one form is activated from another form. This happens automatically, but the point is naturally that the opened form must know which record was active in the form it was opened from. Let's start nice and slow by finding out how to activate a form without using a menu item. You can do this as follows: Args args = new Args('name of form'); FormRun formRun= new FormRun(Args); ; formRun.init(); formRun.run(); formRun.wait(); If there is a form named as specified above under form name, it will now be executed. However, no data will be transferred to the form, since you have not instructed the system to do so. If you wanted to transfer data, the example above would have looked like this: Args args = new Args(); Form form = new Form('form name'); FormRun formRun; ; args.object(form); args.caller(this); args.name('form name'); formRun = ClassFactory.formRunClass(args); formRun.init(); formRun.run(); formRun.wait(); Information exchange3 1.2THE ARGS CLASS The secret behind information exchange lies hidden in objects created from the Args class. Through Menu Items, you can add parameters in the form of text or an Enum of a given value. This data is entered in an object created from the Args class and may be "fished out" using methods for the Args object, parm(), parmEnumType(), and parmEnum(). In the code example above, the methods could also have been used to enter data in the Args object. All methods in the Args class can be viewed in System Documentation, Classes, Args but some of them, such as dataSet() and record(), should be mentioned here. This is because if you open an application element from a form using a menu item, you can then use these methods on the opened element to find out which record was active in the form from which the element was opened, as well as which table the relevant record stems from. You can also use the record() method to enter a record in the Args object. Finally, you have the caller() method. It is used to specify the object from which elements were opened. Information exchange4 1.3ARGS OBJECTS The methods specified in the above section are accessible on objects created from the Args class. The question is therefore how to get hold of the Args objects. You already know that the form or report receives an object of this type. element.args() The code above indicates how to retrieve the Args object. You can therefore, as an extension of the line above, specify a method you want executed on the Args object, or you can link it to an object handle and apply the methods from there. Information exchange5 1.4EXERCISES Exercise 1Opening a Form ?Create a new form displaying CustTable data. ?Then create a menu item used to activate the form. On the properties of the created menu item, you can now specify a parameter and an Enum. ?Then open the form's init or run method and add code that allows you to retrieve parameter and Enum. Exercise 2Opening a Form From Another Form ?Now create another form also displaying CustTable data (make a copy of the first form, and delete the init/run method). ?Enter the menu item you created in the previous exercise in this form. ?Then get the form from the previous exercise, and edit its init- or run method so that return values are printed from the dataset() and record() methods on the form's Args object. Exercise 3Opening a Form From a Job ?Create a job that activates the form from the first exercise. ?Write the code so that the content of the Args object corresponds to that of the second exercise. Information exchange6 Exercise 4Closing Form 1 From Form 2 (Optional Exercise) In the second exercise you activated a form from another form. ?Create a button on the activated form that can be used to close the form it was called from. Information exchange7
本文档为【微软AX培训——Information exchange】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_668482
暂无简介~
格式:doc
大小:23KB
软件:Word
页数:0
分类:互联网
上传时间:2017-12-08
浏览量:11