AX – D365FO – Save previously used Query in a RunBaseBacth class

If yoou want to save last used Query on a RunBaseBatch class just set TRUE the QueryRun.saveUserSetup() method like show in the example below public QueryRun queryRun() { return gQueryRun; } public void initQueryRun() { Query query = new Query(); QueryBuildDataSource inventJournalTableDS; QueryBuildRange inventJournalStatus; QueryBuildRange inventJournalStatusRange; inventJournalTableDS = query.addDataSource(tableNum(InventJournalTable)); inventJournalStatus = inventJournalTableDS.addRange(fieldNum(InventJournalTable, Posted)); inventJournalStatus = … Continue reading AX – D365FO – Save previously used Query in a RunBaseBacth class

AX – D365FO – Methods on a Form Data Source

Original document from Microsoft documentation : https://docs.microsoft.com/en-us/dynamicsax-2012/developer/methods-on-a-form-data-source Each form data source has a set of standard methods. You override these methods when you want to change the behavior for validation, caching, and so on. These methods are a subset of the methods in the FormDataSource system class. You use the AOT to access the standard … Continue reading AX – D365FO – Methods on a Form Data Source

AX – D365FO – How to create a custom filter on list or inquiry form in Dynamics AX 2012

During development we have to create custom inquiry forms. Or Form where we can  search and filter records on different criteria. Consider a scenario, where we have to build custom inquiry form for all saleline. In this inquiry or custom list form, we can filter on records on date, customer and amount or discount. Lets … Continue reading AX – D365FO – How to create a custom filter on list or inquiry form in Dynamics AX 2012

AX – D365FO – Importing CSV Using RunBaseBatch X++

class ImportCsv extends Runbasebatch { Filename ItemFileName; Filename filename; DialogField dialogFilename; #define.CurrentVersion(1) #define.Version1(1) #localmacro.CurrentList fileName #endmacro } public Object dialog() { DialogRunbase dialog = super(); dialogFilename = dialog.addField(typeId(FilenameOpen)); dialogFilename.value(filename); return dialog; } public boolean getFromDialog() { fileName = dialogFileName.value(); return super(); } void ImportInventtable() { CommaIo file = new commaIo(ItemFileName,'r'); Container con; InventTable inventTable; int … Continue reading AX – D365FO – Importing CSV Using RunBaseBatch X++

AX – D365FO – “Unretrieved” value in the table field

"Unretrieved" fields are newly created fields which AX 2012 AX by error treats badly. It may also appear if a form query does not contain a field in the datasource field list. Try these steps to solve the issue : 1.- Recompile and restore table. Check fields with Table explorer; if table explorer doesn't show … Continue reading AX – D365FO – “Unretrieved” value in the table field

AX – D365FO – Cannot see newly created data source on a ListPage Form

When you come back to list page and try to restore the form you will not be able to see the new data source. To do this right click on the data source node and again define the name of the query. This will reload the new structure from the query. 4. Then you can view … Continue reading AX – D365FO – Cannot see newly created data source on a ListPage Form