Custom Parameters

With our latest update (March 6th, 2012), m-Power has been enhanced to now allow developers to pass variables directly from and to any mrc application via FreeMarker. The two main advantages of this enhancement are:

  • You don’t need to rely on Parameter Calculations (Quite useful if you are building your own template and need to easily pass variables from prompt page to output page).
  • You don’t need to worry about cases when no record is found (Traditionally, when no record is found parameter calculations do not exist and thus can not contain any value).

Here’s what you need to do to implement this new built-in feature:

  1. In the example below, we are passing a value using the parameter “NEWPARM”. On your “From” page, you can simply pass a variable through the URL, such as:
    HURCKES.R00010s?run=2&NEWPARM=ABC

    Or if you’d prefer that your end user enter in this value via an HTML form, simply add the following code to m-Painter:

     <input type="text" name="NEWPARM" value="" size="5" />
  2. On your “To” page, you can reference this new parameter as:
    ${custom.parm("NEWPARM")}
  3. (Optional) If your user would ever need to refresh the “To” page (for instance, to run an ad-hoc sort), you will need to add the following syntax so your page can “remember” this parameter:
    <input type="hidden" name="NEWPARM" value="${custom.parm(NEWPARM)}" /> 

Note: m-Power users can use the ${custom.parm(“FIELD”)} FreeMarker substitution to reference any substitution available within their application. For example, if you were interested in knowing what the output format is of your report, you can access the field via this parm: ${custom.parm(“outfmt”)}.

Let us know how you’ve used this new feature by leaving us a note in the comments section!

Related Posts:

One thought on “Custom Parameters

  1. Yes, we use “Custom Parameters” for heading information in apps. “Customer Parameter” come in handy when smartlink parameters in URL get cleared when “no record is found” in application.

Leave a Reply

Your email address will not be published. Required fields are marked *