Some other notable simple query syntax is the range syntax which is just two periods “..”. This represents a range between two values. For example, in a date field you could use it query for customers that have a customer since date between “9/21/2020” and “9/25/2020”. This is the syntax 9/21/2020..9/25/2020
Category: RunBaseBatch
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 – How to SHOW/HIDE Select Query button in a RunbaseBatch class
To show or hide the Select button on a RunBaseBatch class add the "showQuerySelectButton()" method and return true to how to show or false to hide public boolean showQuerySelectButton() { return false; //In this case the button will be hidden. If you want to show just return TRUE }
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 – How to access Args Parameters inside dialog() in a runbasebatch class?
I want to pass the Args.parm() value from Main() method of a RunBaseBatch to the dialog() method of the same RunBaseBatch. First of all declare a new string variable called "argsParm" in the declaration method of the RunBaseBatch class and add it to the #localMacro.CurrentList macro /// </remarks> class TaxReport extends RunBaseBatch { NoYes updateNow; … Continue reading AX – D365FO – How to access Args Parameters inside dialog() in a runbasebatch class?
AX – D365 – Add a popup simple dialog form into a a Runbase Form
Suppose you have a Runbase dialog but before do something you want to ask user if he's really sure he want to proceed with the elaboration. After clicking OK a popup dialog form opens and asks the user if he wants to proceed If ho click OK the elaboration starts, otherwise if he clicks on … Continue reading AX – D365 – Add a popup simple dialog form into a a Runbase Form
AX – D365FO – Prevent from closing Runbase after pressing OK or Close button
Suppose you have a Runbase dialog but before do something you want to ask user if he's really sure he want to proceed with the elaboration. After clicking OK a popup dialog form opens and asks the user if he wants to proceed If ho click OK the elaboration starts, otherwise if he clicks on … Continue reading AX – D365FO – Prevent from closing Runbase after pressing OK or Close button
AX – D365FO: Runnable Class with Parameters
This is a runnable class that extensds Runbase thet we want to obtain : class ABJ_RunnableClassUnpostPayrollPayStatement extends RunBase { PayrollPayStatement payrollPayStatement; PayrollPayStatementRecId payrollPayStatementRecId; DialogField fldPayrollPayStatement; public container pack() { return conNull(); } public boolean unpack(container packedClass) { return true; } public Object dialog() { Dialog dialog = super(); dialog.caption(‘Unpost Payroll Pay Statement’); fldPayrollPayStatement = dialog.addField(extendedTypeStr(PayrollPayStatementRecId), … Continue reading AX – D365FO: Runnable Class with Parameters
AX – D365FO – Add a default value to a dialog field in a RunBase dialog (or RunBaseBatch)
If you want to add a default value in a RunBase dialog field you can use dialog.addFieldValue() in the dialog() method : public Object dialog() { dialog = super(); dialog.addGroup("@SYS7764"); dialogCurrency = dialog.addFieldValue(ExtendedTypeStr(CurrencyCode), 'EUR', "Currency"); return dialog; }
AX – How to add a file dialogField in a RunBase (or RunBaseBatch) dialog
We need to add a file type dialog field in a RunaBase or RunBaseBatch dialog How to do in x++ Class Declaration class ImportDemandForecastCSV extends RunBaseBatch { DialogRunbase dialog; DialogField dialogFileName; FileName fileName; #define.CurrentVersion(1) #define.Version1(1) #localmacro.CurrentList fileName #endmacro } public Object dialog() { dialog = super(); dialog.addGroup("@SYS7764"); dialogFileName = dialog.addField(ExtendedTypeStr(Filenameopen), "File Name"); return dialog; } … Continue reading AX – How to add a file dialogField in a RunBase (or RunBaseBatch) dialog