Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

AX 2009 Passing parameter from Button into Reports (MorphX) Query as to be used in Select clause

$
0
0

Hello,

I have a following code behind my Form's Button which passes parameter into Form's Query object 

Args args = new args();
ReportRun reportRun;
PrintJobSettings pjs;
;

pjs = new printJobSettings();
args.parm("PRD_00000007");
args.name(reportstr("ReportTest"));
reportRun = classFactory.reportRunClass(args);
pjs.setTarget(PrintMedium::Printer);
reportRun.setTarget(PrintMedium::Printer);
reportRun.init();
reportrun.run();
super();

In Form's Init-method I handle this parameter like this way

public void init()
{
str var;
;

var = element.args().parm();

try
{
  if(element.args().parm())
  {
   this.query().dataSourceTable(tablenum(ProdTable))
     .addRange(fieldnum(ProdTable, ProdId)).value(element.args().parm());
   this.query().userUpdate(false);
   this.query().interactive(false);
   super();
  }
 }
  catch(exception::Error)
  {
   info("Error in init method");
  }
}

Problem is that do I have set someting more into Query object because when Debugging Form's code I see the parameter

but still Query object executes Select * from ProdTable    instead of    Select * from ProdTable where ProdId = '"PRD_00000007'

What am I missing?

Best Regards,

Michael


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>