Bojensen Blogs

Using RunBaseBatchPrintable class

RunBase framework is used when we develop a class to run an operation within Dynamics AX, such as posting a sales order or used in any data manipulation operation. If we need to batch the operation, we will commonly use the RunBaseBatch framework by extending the RunBaseBatch class.

Dialog for a class that extends RunBaseBatch
The RunBaseBatch class does not provide the access to printer such as when running a report. If you need to provide the printer support to allow users to specify the printer options in the operation, you can extend the RunBaseBatchPrintable class instead of RunBasebatch class.

Dialog for a class that extends RunBaseBatchPrintable
When extending the RunBaseBatch class, you need to override the pack() and unpack() methods. If query is used in the operation, you may need to also override the initParmDefault(), queryRun(), and showQueryValues() methods.

When extending the RunBaseBatchPrintable class, in addition to the above methods, you would also need to make the following amendments:

1) Modify the pack() to serialise the printJobSettings object (inherits from RunBaseBatchPrintable class)
2) Modify the unpack() to deserialise the printJobSettings object
3) To retrieve the user-selected printer settings, you can use the printJobSettings variable directly in the code. For example:

Happy DAXing!!

Originally posted on

Comments are closed.