dynamics-ax-2012

Table Update Event Handler

点点圈 提交于 2020-01-13 01:55:14
问题 I am investigating the capabilities of the new delegate & event subscription pattern in AX 2012. At the moment I am looking to detect when a particular field has been modified, for example when SalesTable.SalesStatus is changed to SalesStatus::Invoiced . I have created the following post-event handler and attatched to the SalesTable.Update method; public static void SalesTable_UpdatePosteventHandler(XppPrePostArgs _args) { Info("Sales Update Event Handler"); } Now I know I can get the

Update records that can be retrieved by multiple joins in x++

时间秒杀一切 提交于 2020-01-11 14:28:29
问题 So I have a complete x++ script that aims to update records based on the retrieved result set made with select query with multiple joins and using crosscompany As I have been told, it is not a good idea to update records when there is crosscompany. Can you give expert advice on how to do it the best practice way considering my current script. here is the script static void UpdateSample(Args _args) { InventTable a; InventTableModule b; EcoResProduct c; EcoResProductCategory d; EcoResCategory e

How to make invisible the lookup field?

耗尽温柔 提交于 2020-01-07 03:08:20
问题 I want to take a value from lookup field. But I neet to make invisible this field. My code is this: public void lookup() { Query query = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(MYTable), this); sysTableLookup.addLookupField(fieldNum(MYTable, FieldTableA)); sysTableLookup.addLookupField(fieldNum(MYTable, FieldTableB)); sysTableLookup.addLookupField(fieldNum(MYTable, RecId),

How to rename dialog box buttons or create new in Ax 2012?

谁说我不能喝 提交于 2020-01-04 12:49:10
问题 Is it possible to rename dialog box buttons? For example on "okCancel" can I rename the "ok" button as "continue" ? If not please guide me how can I create my own dialog box? Thanks ahead. 回答1: A button has a "Text" property. You can set that property or do so by code: okButton.text("Continue"); The Box::okCancel uses the DialogBox class which is a kernel class and cannot be changed. The yesNoAxaptaForm method on the other hand uses an AX form, so you can roll on your own. That said it seems

How to create a lookup with fields from more than one datasource?

只愿长相守 提交于 2020-01-01 15:35:10
问题 I need to create Dynamic lookup in my form field which should display fields from two different datasources.. I am trying to perform it as: public void lookup() { query = new Query(); sysTableLookup = SysTableLookup::newParameters(tableNum(smmBusRelTable), this); qbds = query.addDataSource(tablenum(smmBusRelTable)); // qbds.addDataSource(tableNum(DirPartyTable)); //qbds.relations(true); sysTableLookup.parmQuery(query); sysTableLookup.addLookupField(fieldNum(smmBusRelTable, Busrelaccount)); /

how to get static range in your report

蓝咒 提交于 2019-12-25 15:54:19
问题 In AX Report the User can select different Range. I seek to show that the criteria used to filter user in the report itself even the expression "parameter!CustomerAccount.Value" don't work because this filter is not a static parameter. the user can use any table from the query and any field from the table and any criteria.. I'm locking for trick to get for which table, which field and what criteria it uses. 回答1: this method work very well ^_^ (( I use it privet and not static )) static void

How to get RecId selected from lookup method?

大城市里の小女人 提交于 2019-12-25 13:20:16
问题 I want to get the RecId selected from lookup method? In lookup method in StringEditLookup_ZipCode public void lookup() { Query query = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(LogisticsAddressZipCode), this); sysTableLookup.addLookupField(fieldNum(LogisticsAddressZipCode, ZipCode)); sysTableLookup.addLookupField(fieldNum(LogisticsAddressZipCode, City)); sysTableLookup

How to get RecId selected from lookup method?

拥有回忆 提交于 2019-12-25 13:18:22
问题 I want to get the RecId selected from lookup method? In lookup method in StringEditLookup_ZipCode public void lookup() { Query query = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(LogisticsAddressZipCode), this); sysTableLookup.addLookupField(fieldNum(LogisticsAddressZipCode, ZipCode)); sysTableLookup.addLookupField(fieldNum(LogisticsAddressZipCode, City)); sysTableLookup

How to get RecId selected from lookup method?

回眸只為那壹抹淺笑 提交于 2019-12-25 13:18:13
问题 I want to get the RecId selected from lookup method? In lookup method in StringEditLookup_ZipCode public void lookup() { Query query = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(LogisticsAddressZipCode), this); sysTableLookup.addLookupField(fieldNum(LogisticsAddressZipCode, ZipCode)); sysTableLookup.addLookupField(fieldNum(LogisticsAddressZipCode, City)); sysTableLookup

How to refresh/Synch View based on a Query with dynamic range?

和自甴很熟 提交于 2019-12-25 05:36:14
问题 I have a simple View with a Query , my custom Query has a Dynamically Range . In class SysQueryRangeUtil I have insered a my custom public static method and copy it in my Custom Query. This range, work well. But I have a problem, when the range condition change, if I want to see the new view(with new selected record) I have to Synch, in AOT my View. But this operation can't do a simple SystemUser. There is a way to use a dynamic range in a View and not constantly synchronize ? My dynamic