Merge Tags

<< Click to Display Table of Contents >>

Navigation:  General Functions > Configuring the MIE (Programmer's Guide) > Merging HTML >

Merge Tags

Merge Tags look very similar to general tags.  The difference is that Merge Tags may only be used when merging input with an HTML template - and only on the template itself.  General tags may also be interspersed with Merge Tags on the template.  

Merge Tags may never by embedded within other tags.

Merge Tags take the following form:

 {%<Action or IID>,<tag parameter1>,<tag parameter2>,...,<tag parameterN>%}

The {% sequence delimits the start of a tag and the %} sequence delimits the end.  All tags must be enclosed by a start and end delimiter sequence.

The following Merge tags are supported and may be used any where Merge tags can be used:

{%MESSAGE,LOCKED,<message>%}

Insert the message displayed by the MIE when the record is locked.  Applies to forms that have been set to allow record locking.

{%MESSAGE,SUCCESS,<message>%}

Insert the message displayed by the MIE when the current operation or step was successful.

{%MESSAGE,ERROR,<message>%}

Insert the message displayed by the MIE when the current operation or step encountered an error.

{%<iid>,INPUT,[<tab>],[<default>],[<required>],[<readonly>],[<javascript>],[<class>],[<input type>],[<business rule #>]%}

Insert an HTML input control.  <iid> specifies the name of the input control as defined in the MIE's inputs table, and must match the iID value of the record.  The control will be inserted based on how it has been defined in the MIE's inputs table, as well as any overrides that have been specified for the field.  

<tab> - optional tab on which the control is to be placed (not used)

<default> - optional default value.  If left blank, current definition will be used.

<required> - optional. 0 if an entry is not required, -1 if an entry is required.  If left blank, current definition will be used.

<readonly> - optional. 0 if field is not readonly, -1 if field is to be set to readonly.  If left blank, current definition will be used.

<javascript> - optional.  Defines javascript which will execute based on various events associated with the input control, such as "OnChange".  Javascript is written in line and is specified exactly as it would be in the HTML statement.  

Example:  OnChange=InputForm.Action.value='REFRESH';InputForm.submit();

If javascript is to be specified for more than one event, such as OnClick and OnChange, separate each definition with the piping character ("|").

If left blank, current definition will be used.

<class> - optional.  Specifies the Cascading Style Sheet class to be used, which can be used to change the font and other attributes.  If left blank, current definition will be used.

<input type> - optional.  Specifies the type of HTML input control to be inserted.  Typically used to convert a visible control to hidden in order to forward a default or system-assigned value to the target data table and column.  If left blank, current definition will be used.

<business rule #> - optional.  Specifies a business rule which will override the currently assigned rule.  The new business rule is defined in the MIE's business rule table, and is specified using the primary key of the record, bLogicNo.  If left blank, current definition will be used.

{%<iid>,CAPTION,,[<replacement caption>],[<required>]%}

Insert a caption for an HTML control.  <iid> specifies the name of the input control as defined in the MIE's inputs table, and must match the iID value of the record.  The currently defined caption will be inserted.

<replacement caption> - Optional.  Overrides the caption defined in the database.  If left blank, current definition will be used.  

<required> - optional. 0 if an entry is not required, -1 if an entry is required.  If left blank, current definition will be used.  This is used to decide if an asterisk will be displayed after the caption.  This should agree with the same override setting for the INPUT tag.

At first it would seem unnecessary to use this tag, especially if specifying a replacement caption.  The obvious question is "what is the difference between this tag and just using HTML?"  The answer is that when you use the caption tag, the caption you specify is forwarded to the validation logic and is used by the validation logic to refer to the appropriate field on the screen when generating error messages.  Static HTML will not be forwarded to the validation logic.

{%<iid>,VALUE,[FORM],[<format>]%}

Insert the value from an HTML control, typically after the form has been posted back to the MIE and returned.  <iid> specifies the name of the input control as defined in the MIE's inputs table, and must match the iID value of the record.

FORM - optional.  If specified, the value is taken directly from the form variables using a Request.Form("<iid>") statement.  Otherwise, the value is taken from the MIE's form control array.  Generally, the safest way to pull a value from a form after post-back is to use the FORM option.

<format> - optional.  Causes the value to be formatted using one of the MIE's pre-defined formatting strings.  If left blank, current definition will be used.

{%<iid>,START[=ADDHIDDEN]%}

<iid> specifies the name of the input control as defined in the MIE's inputs table, and must match the iID value of the record.  If the input variable defined by <iid> is currently in scope, everything (HTML included) after this tag will be included until the accompanying END tag.  If the <iid> variable is not in scope, everything (HTML included) between this tag and the accompanying END tag will be excluded.  This, and the END tag, allow for conditional HTML to be specified.

The MIE allows any input variable to be conditionally displayed.  The variable is considered in scope when the conditions for its display have been met, and out of scope otherwise.  Conditions that can be applied include a minimum required access level, and the values of one or more other input variables that are currently part of the form.  

The <iid> may be a hidden variable used strictly to turn on or off certain sections of the HTML.  One common usage is to specify a multi-page wizard where one section of HTML is displayed per wizard step.

ADDHIDDEN - Optional. If specified, any INPUT tags that are encountered in out-of-scope HTML will be included as HIDDEN variables.  This allows their values to be carried backward and forward through various steps.  ADDHIDDEN is very useful when designing wizards.  If not specified, if the region is out of scope then all HTML and tags will be omitted.

{%<iid>,END%}

Companion tag to the START tag.  This tag must be present to mark the end of a conditionally displayed region.  The <iid> must match the <iid> specified in the START tag.  

START and END tags can be nested.

{%STEP=<n>%}


{%<iid>,EMAIL,<WorkTRAK email template name or number>,<email to>[|FORM],[<variable1>[|FORM]],[<variable2>[|FORM]],[<variable3>[|FORM]],[<variable4>[|FORM]],[<variable5>[|FORM]],[<variable6>[|FORM]]%}

Causes an email to be sent when encountered.

<iid> - ignored.

<Workflow Automation email template name or number> - Specifies the template to be used when forming the email.  Templates are defined using Workflow Automation-Email-Templates.  Will accept either the description or number.  Use of number is preferred as it will not change.  The template defines the email subject and body.

<email to> |FORM - Email to is required. |FORM is optional.  When |FORM is used, the email to address is pulled from the current form using  Request.Form(<email to>).  This allows the email address to be variable.  If |FORM is not specified, the email to is interpreted as the actual email address.  The character before FORM is the piping character ("|").

<variableN> |FORM - Variables 1 through 6 are optional.  They are simply passed to the email template where they may be referenced as tags V1 through V6 in the template.  This allows for variable message content.  If
|FORM is specified, the value is pulled from the current form using Request.Form(<variableN>).  Otherwise, the value is interpreted as a literal value.  If left blank, a blank value will be passed to the template.