Generate a report using a class and temporary table

Hi All,

I want to create a report say… “JournalTransactions” and it uses a temporary table as its data source “tmpjournaltransactions” now I have created a class “generatejourntrans” which populates temporary table “tmpjourntransactions” using AOT table “LedgerjournalTrans”. now there is a main method written in this class which is passing some parameters …which I dont know.

// LedgerjournalTable ledgerJournalArgs;

if(args && args.record() && args.record().TableId == tablenum(LedgerJournalTrans))

{

ledgerJournalTrans = args.record();

ledgerJournalArgs = ledgerJournalTrans.ledgerJournalTable();

generatejourntrans.parmLedgerJournalTable(ledgerJournalArgs);

}

Whats this args.record() is passing parameters from where to where ? I have used a action menu item to invoke the class.

Args.record() may be set automatically from a data source (if called from a form) or in X++ code.

Hii Martin,

I know that martin the problem is what that if statement is checking I dont know that…parameters are being passes but from where to where …?

From what I just described to the main() method, where the record in put into ledgerJournalTrans variable. What else do you mean by “from where” and “to where”?

Ok…take a look at this …

What I want is to create a class “Generatecusttrans” which is invoked from a action Menu Item.This class displays a dialogue box with a range on customeraccount…and whichever custaccount is selected …the class generates a report containing customer transactions for the acount selected on the dialogue box.The datasource of the report is a temporary table “tmpcusttrans” which is populated in the class “Generatecusttrans” using standard AX table “custtrans”…

I have taken the dialogue values and done all the stuff of writing the query…can u tell me what the main method of this class will look like ?

main() usually creates an instance, fills parameters and starts the actual process. From what you’re saying, it seems that the class should extend SrsReportRunController, therefore the logic would be triggered by startOperation() method.

But I can only guess what you want to do in which method.