1. Home
  2. General
  3. Custom Parameters

Custom Parameters

Overview

m-Power allows developers to pass variables directly from and to any mrc application via Freemarker. There are two main advantages of this feature:

  • 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).

Implementation

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

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" length="10" name="NEWPARM" value="" />

The value="" attribute is intentionally left blank, as the user will supply a value to this input field in the maintainer form.

On your “To” page, you can reference this new parameter as:

${custom.parm("NEWPARM")}

(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 name="NEWPARM" type="hidden" 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")}.

Updated on August 2, 2023

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
CONTACT SUPPORT

Comments

  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.

Comments are closed.