Skip to main content
Solved

Adding command with parameter for accessing SQL Quick report

  • January 11, 2024
  • 4 replies
  • 240 views

Forum|alt.badge.img+2
  • Do Gooder (Partner)
  • 6 replies

Hi,

I'm currently trying to add new command to the Suppliers page, which leads to SQL quick report based on this entity. I need the quick report to run just on the selected suppliers. Is there a way to do it? There is a possibility to add parameter when creating the command, but I cannot figure out how to make it work.

Adding SQL Quick report command parameter

I believe that selection should be based on SupplierId from the selected supplier(s). So I put it into the “Context value” on the right. But what should go into “Destination Attribute field?

Also - is there necessary WHERE clause in the Quick Report SQL statement, or should I leave it without it?

 

Best answer by Marcel.Ausan

@zila the destination attribute is the filtering condition from your where statement in the Quick Report.

In my example I have a quick report where I can filter by Project ID

 

Then you will see your Quick Report parameters in the Destination Attributes:

 

In my case, the relation is like this:

 

And when I run the command, the Quick report is executing and implicitly filtering for the project id 1210 where I’m at:

 

So, what you’re missing is the filtering attribute in the Quick Report.

and a.project_id = '&Project_Id'

 

I hope this helps!

4 replies

Marcel.Ausan
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 1306 replies
  • Answer
  • January 11, 2024

@zila the destination attribute is the filtering condition from your where statement in the Quick Report.

In my example I have a quick report where I can filter by Project ID

 

Then you will see your Quick Report parameters in the Destination Attributes:

 

In my case, the relation is like this:

 

And when I run the command, the Quick report is executing and implicitly filtering for the project id 1210 where I’m at:

 

So, what you’re missing is the filtering attribute in the Quick Report.

and a.project_id = '&Project_Id'

 

I hope this helps!


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Partner)
  • 6 replies
  • January 11, 2024

@Marcel.Ausan It works! Thanks a lot! I have a sub-question though. Is there a way how to pass multiple selections? For now it works just for one selected supplier.


Marcel.Ausan
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 1306 replies
  • January 11, 2024

Forum|alt.badge.img+2
  • Author
  • Do Gooder (Partner)
  • 6 replies
  • January 11, 2024

@Marcel.Ausan  Ok. In that case I will check with the client if this solution works for them. If not, I can try to create new entity with the necessary data and page with list from this entity. This solution should provide requested functionality. Thank you very much for your help!