x++

How can I loop over Tables which contain specific characters in their AOT name and delete the data?

↘锁芯ラ 提交于 2019-12-24 16:43:00
问题 I want to loop over a few tables where the name (aotName) begins with 'HbcCka', finally I want to delete all data from the tables. Now I need a logic to empty the tables. How can I achieve this? UPDATED: static void tstDeleteForecastingData(Args _args) { Dictionary dictionary = new Dictionary(); int i; SysDictTable dictTable; ; for (i=1 ; i<=dictionary.tableCnt() ; i++) { if (strScan(tableid2name(dictionary.tableCnt2Id(i)), "HbcCka", 1, strLen(dictionary.tableName(i)))) { info(strfmt('%1;%2',

Adding scrollbar to a Group in AX 2012 form

回眸只為那壹抹淺笑 提交于 2019-12-24 01:00:00
问题 I need to set scrollbar in a Group as shown below since there are many more vertical fast tabs are available which are getting hide when opening any tab as you can see below . I have used tab and selected style as Fasttab. I have tried to set Scrollbar property of tab and its tabpages to yes but for no result. Any help would be great!!! 回答1: I have resolved the issue. by setting height and width properties correctly. properties are: Group:- Height:column width width :column width Tab:- Height

catching the warning message from aif web service

感情迁移 提交于 2019-12-23 10:16:33
问题 I have a aif service in ax 2012 . I pass information into it from .net applications. basically i'm posting to the general journal. But when there is an error, say bad information being passed in, it returns a general error usually "error validating record" . But the warning message displays the actual reason why it caused an error such as the bad data. Is there a way to catch and display the warning message. I tried exception::warning but it just goes right to the exception::error . catch

filter look up in dialog

怎甘沉沦 提交于 2019-12-23 04:47:46
问题 I Have created a dialog in a class, the dialog method is as below static void dialog(Args _args) { Dialog dialog; DialogField dialogFieldCurrentState; DialogField dialogFieldNewState; CustInvoiceTable custInvoiceTable; ; custInvoiceTable = _args.record(); dialog = new Dialog("Change State"); dialogFieldCurrentState = dialog.addField(TypeID(State_LT),"Current State: "); dialogFieldCurrentState.value(custInvoiceTable.State); dialogFieldCurrentState.enabled(false); dialogFieldNewState = dialog

Merge several different dynamics AX reports in one

荒凉一梦 提交于 2019-12-23 03:33:22
问题 I'm investigating if it is possible to send three different Ax 2009 reports to only one output. We already have an example of merging multiple invoices using the SalesInvoice report into one output, but this is not what we want. The output would need to be generated by X++ and would contain for example: SalesInvoice SalesPurchInvoice_RU AKT_RU Any pointers? An ' It can't be done. ' is an acceptable answer! Thanks 回答1: It can't be done. Not in AX at least. But you could generate PDF then

How to get a Common object from a table id?

感情迁移 提交于 2019-12-23 02:52:27
问题 How to instantiate a common type object (the table's base class in AX) via a TableId ? Furthermore what else can we do with TableId? My goal is to send tableid to my method and there, I will make the buffer of the table the id belongs to. Is it possible? 回答1: It can be done like this: public static Common makeRecord(TableId _tableId) { return new DictTable(_tableId).makeRecord(); } 回答2: Yes you can do this. Here is a webpage explaining: http://www.doens.be/2009/07/select-a-record-from-a-table

Display Methods - Multiple Form Data Sources

微笑、不失礼 提交于 2019-12-22 08:27:02
问题 This may seem a simple question, but for some reason I am vexed. I have a form with 3 datasources - InventTable , InventSum , InventDim . So, for example, my grid shows; Item, Name, Site, Warehouse, Physical Stock I have placed a display method on InventDim form DataSource, but I need access to the ItemId from either inventTrans or InventSum . (Obviously looking for the "current" itemId). All I can access is the inventDim which is passed as a parameter _inventDim , as standard. What is the

Reading a comma separated values (csv) file in dynamics ax

扶醉桌前 提交于 2019-12-22 05:17:11
问题 How do you open and parse a csv file in dynamics ax? 回答1: static void TestCommaTextIO(Args _args) { #File CommaTextIo commaTextIo; FileIOPermission permission; container containFromRead; int x; int cols; ; permission = new FileIOPermission('c:\\junk\\mycsv.csv',#io_read); permission.assert(); commaTextIo = new CommaTextIO('c:\\junk\\mycsv.csv','R'); containFromRead = commaTextIo.read(); While(containFromRead) { cols = conLen(containFromRead); for(x=1;x<=cols;x++) { print conpeek

Code crashes at iteration 86

蓝咒 提交于 2019-12-20 03:12:08
问题 static void Job47(Args _args) { str path,stx; TreeNodeIterator iter; TreeNode treeNode, treeNodeToRelease; Map dictMenuDisplay; FormName formName; MenuItemName menuItemName; container conMenu; int i,n; ; for (n=1;n<=100;n++) { info(strfmt("iter:%1",n)); path ="Menu Items\\Display"; dictMenuDisplay = new Map(Types::String,Types::Container); treenode = Treenode::findNode(path); iter = treenode.AOTiterator(); treenode = iter.next(); while (treenode) { formName = treenode.AOTgetProperty("Object")

Use methods in where statements

半腔热情 提交于 2019-12-20 02:56:25
问题 Table table; select * from table where this.id != table.id && this.foo(table); I am trying to make a selection from a table in X++ code. The table is compared against a record from the table ( this ). A record shall be added to the selection if the id of the record and another record from the table do not equal and several other conditions in foo() evaluate to true. The plan is to make this.foo(table) evaluate the record together with each other record in the table. When I insert the code