Execute task command

During the last weeks i had to create a new form with multiple datasources. In the first moment it sounds simple. Up to this point it is too. But some new functionalities later i wanted to refresh the forms datasources. The common approach is to do a research/refresh/reread on the datasources. But that was not … Read moreExecute task command

Auto search on form data source

Following scenario: You are creating a new form in AX2012. You are adding a form data source, for example the ProdTable, inserting some fields to the interface. But you don’t want the form to show always the first dataset of the ProdTable on your form fields. In that case you can set the property “AutoSearch” … Read moreAuto search on form data source

Display String as barcode

There are several different classes in AX which can convert a simple string to a specific barcode format. I used the following example to convert a string to a EAN128 barcode and display it in a simple dialog in AX2012R3: Which font code you need is declared in the classes “Barcode*” classes. You can initialize … Read moreDisplay String as barcode

Active InventDim dimension on ListPage

If you want to check on a list page if a specific inventDim dimension is active and shown on the grid the following code can check that case: (The example checks if the invent batch id is displayed on the grid:   if (element.inventDimSetupObject().parmDimParmVisibleGrid().InventBatchIdFlag) { // Display some new field }  

Unit conversion

Simple code for converting between two units: unitOfMeasureInvent = InventTableModule::find(itemId, ModuleInventPurchSales::Invent).UnitId; if (unitOfMeasureInvent != unitOfMeasure) { convertedQty = UnitOfMeasureConverter::convert(qty, UnitOfMeasure::unitOfMeasureIdBySymbol(unitOfMeasure), UnitOfMeasure::unitOfMeasureIdBySymbol(unitOfMeasureInvent), NoYes::No, InventTable::itemProduct(itemId), NoYes::No); }

Form data source overwrite lookup || AX 2012

You can use the following code overwriting the default lookup method on a form data source field:   public void lookup(FormControl _formControl, str _filterStr) { Query query = new Query(); QueryBuildDataSource qbds; QueryBuildDataSource qbdsJoin; // Instantiate sysTableLookup object using table which will provide the visible fields SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(VendTable), _formControl); ;   qbds= query.addDataSource( … Read moreForm data source overwrite lookup || AX 2012