Loop all tables

  • September 16, 2010
  • 1 Comment

There is a simple trick to loop all tables that are available in Ax. Just use the Dictionary-class that contains all information about tables. Small example to list all tablenames + their corresponding Id. 1 2 3 4 5 6 7 8 9 10 static void JeDoe_listTables(Args _args) { Dictionary dictionary = new Dictionary(); int … Continue Reading

A few things you should know about temporary tables

  • May 10, 2010
  • 2 Comments

How do you set a table temporary: You can set the property ‘temporary’ in the AOT to yes –> this table is always temporary You can declare a buffer of a table and call the method setTemp() or setTempData(), from that moment on the buffer contains temporary data. CustTable custTable; ; custTable.setTmp(); if (custTable.isTmp()) { … Continue Reading

List of mandatory fields on a table

  • February 22, 2010
  • 0 Comments

When you want a list of all the mandatory field on table X, yould check all the properties on the table fields, or you could be lazy and write a small job that does the trick for you. Just replace TableId with your tablenum. 1 2 3 4 5 6 7 8 9 10 11 … Continue Reading

Moving DB-objects to other layers … without losing data

  • February 14, 2010
  • 0 Comments

Most of us have already been confronted with the problem of tables being inserted in the wrong layer, and when they already contain data it is very difficult to transfer these objects to the correct layer without losing data. I found the following article on Axaptapedia that helps you with this issue: http://www.axaptapedia.com/Move_DB_objects_to_another_layer

Select a record from a table when you only have the tableId

  • July 16, 2009
  • 1 Comment

The following code can provide you a generic way to update a table when you only have the tableId. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public Common findRecord(TableId _tableId, RecId _recId, Boolean _forUpdate = false) { Common      common; DictTable   dictTable; ; dictTable = new DictTable(_tableId); common … Continue Reading