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 – 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 – 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