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="" />
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')}"/>
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.