{"id":1201,"date":"2012-03-06T12:00:09","date_gmt":"2012-03-06T18:00:09","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/techblog\/?p=1201"},"modified":"2023-08-02T14:50:13","modified_gmt":"2023-08-02T20:50:13","slug":"custom-parameters","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/techblog\/?ht_kb=custom-parameters","title":{"rendered":"Custom Parameters"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p>m-Power allows developers to pass variables directly from and to any mrc application via Freemarker. There are two main advantages of this feature:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You don&#8217;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).<\/li>\n\n\n\n<li>You don&#8217;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).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<p>Here&#8217;s what you need to do to implement this new built-in feature.<\/p>\n\n\n\n<p>In the example below, we are passing a value using the parameter &#8220;NEWPARM&#8221;. On your &#8220;From&#8221; page, you can simply pass a variable through the URL, such as: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>HURCKES.R00010s?run=2&amp;<strong>NEWPARM<\/strong>=ABC<\/code><\/pre>\n\n\n\n<p><strong>Or<\/strong>\u00a0if you\u2019d prefer that your end user enter in this value via an HTML form, simply add the following code to m-Painter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;input type=\"text\" length=\"10\" name=\"NEWPARM\" value=\"\" \/><\/code><\/pre>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon\">The <code>value=\"\"<\/code> attribute is intentionally left blank, as the user will supply a value to this input field in the maintainer form.<\/p>\n\n\n\n<p>On your &#8220;To&#8221; page, you can reference this new parameter as: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>${custom.parm(\"NEWPARM\")}<\/code><\/pre>\n\n\n\n<p>(Optional) If your user would ever need to refresh the &#8220;To&#8221; page (for instance, to run an ad-hoc sort), you will need to add the following syntax so your page can &#8220;remember&#8221; this parameter: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;input name=\"NEWPARM\" type=\"hidden\" value=\"${custom.parm('NEWPARM')}\"\/><\/code><\/pre>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><strong>Note: <\/strong>m-Power users can use the <code>${custom.parm(\"FIELD\")} <\/code>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: <code>${custom.parm(\"outfmt\")}<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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: Implementation Here&#8217;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 &#8220;NEWPARM&#8221;&#8230;.<\/p>\n","protected":false},"author":3,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[153],"ht-kb-tag":[],"class_list":["post-1201","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-general"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/1201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1201"}],"version-history":[{"count":34,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/1201\/revisions"}],"predecessor-version":[{"id":11996,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/1201\/revisions\/11996"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1201"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-category&post=1201"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-tag&post=1201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}