JScript Helpers dlg.EditValue() from {CALL:x} inside Report


Has anyone managed to use the Helper dlg.EditValue() from within a REPORT Tag calling a {CALL:x} script? The Test Script is simple:

Using @QMcKay examples in the Tutorial -

function Search(stringvar)
	  // Text("Product 1|STUB|23<!rn>Hahn Prem Light|BOT|<!rn>Product 3|GLASS|70<!rn>")
	  //dlg.ShowMessage('stringvar:' +stringvar) ;

	  var cctype = dlg.AskQuestion("Choose Credit Card type","Amex=AMEX,Master Card=MAST,Visa=VISA,Discover=DISC,Other=OTHR,CANCEL=CANCEL") ;
	  //dlg.EditValue("Last 4 CC Digits;.{4};;ON","");
      return stringvar ;

The REPORT Tag calling the Script:

[Purchase Orders:4,2, 1]
{CALL:Order.Search("{REPORT CONSUMPTION DETAILS:C.Name,C.Unit,C.Inventory}")}

The Goal:
I am trying to save creating Entities screens, Report Widgets etc by simply prompting the User for a Search Text Var before running a REPORT from the Reports Tile.

Of course if I test the Script it works fine and prompts the User. Unfortunately if I call the script from the Report Tag it fails.

The Report will actually be an {SQL Details:x} tag to create a query to Print a Inventory Purchase Order.
Thanks Paul.

EDIT!: It seems only dlg.ShowMessage works :confused:


No. Reports are not designed to be “interactive” in that manner. I can understand you want to not need to create Entity Screens, but you still have options.

The Report Widget in an Entity Screen can be set dynamically to display whatever report you want. So you can still have 1 Entity Screen, with a search function, and based on the return of that dialog, you switch the Report that is in the Widget, even supplying parameters to the Report.

For example, way back when, I used to flip reports in/out for the Payroll (several Reports, 1 per employee that were all the same, except for the Entity that was hard-coded in the Report). That was done with Set Widget Value action. So that should work for you.

Now I don’t bother with having a separate Report per Employee; I have 1 Report that has parameters, and I just refresh the Report by sending in different parameters with Refresh Custom Report Widget. In fact, that should work for you too. That Action, IIRC, has a parameter for the Report Name as well as parameters.

You could basically build your own mini Report Explorer if you want, but with much more functionality. In fact, I never use the Report Explorer because of it’s lack of features, like parameter support.