Salesforce

Merge Tags (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Merge Tags (Magic xpa 4.x)

The template file may be of any type as long as the Magic xpa merge tags are stored as regular ASCII strings.

Merge tags have the following generic form:

{Token Prefix}{Token[_name]}{Token Suffix}

where Token Prefix and Suffix are defined for each I/O repository entry. By default the Token Prefix and Suffix are defined as <!$ and > respectively.

The {Token[_name]} part of the tag is one of the following:

<!$MG_NAME>

Matched during runtime with a data element defined in the Tags repository of the Merge Properties dialog box under the same name. If a match is found, the value replaces the tag during the Form Output operation.

<!$MGREPEAT>

Defines the beginning of a repeated area. The repeated area is duplicated and processed for each Form Output operation, thereby allowing for an unknown number of data rows. The tag is removed from the output.

See also:

How Do I Insert Repeatable Data into a Predefined Template?

How Do I Insert Repeatable Data into a Table Format in a Predefined HTML Template?

<!$MGENDREPEAT>

Defines the end of a repeated area. The tag is removed from the output.

<!$MGIF_NAME>

Defines the start of an IF block. The name specified is matched with a data element defined in the Tags repository of the Merge Properties dialog box. The data is assumed to be logical and is evaluated. If the data is True, the rest of the IF block is processed. Otherwise the ELSE block is processed. If the data does not evaluate to a logical value, the data is assumed to be True. The tag is removed from the output.

<!$MGELSE>

Defines the start of an ELSE block and the end of an IF block, which must precede the ELSE block. The ELSE block is processed if the name data value of the IF block evaluates to False. This tag is optional. The tag itself is removed from the output.

<!$MGENDIF>

Defines the end of an IF block, or an ELSE block if one exists. This tag is mandatory if a <!$MGIF_NAME> exists. The tag is removed from the output.

<!$MGINCLUDE>

Lets you include an entire HTML file during the Merge process. This beginning tag is followed by the name of the file to be included. The file name can be a tag itself. The Include process takes place after the file is fully merged.

See also How Do I Embed a File into a Predefined Template?

<!$MGENDINCLUDE>

Defines the end of the Include command. This tag is mandatory if the MGINCLUDE tag exists.

Examples:

<!$MGINCLUDE> \tmp\t1.html <!$MGENDINCLUDE>
includes the file t1.html in the current HTML template file.
<!$MGINCLUDE> <!$MG_T1> <!$MGENDINCLUDE>
includes the file referred to by the <!$MG_T1> tag in the current HTML template file.

Syntax Rules

The number and order of the <!$MGREPEAT> and <!$MGENDREPEAT> tags must match.

The number and order of the <!$MGIF_name>, <!$MGELSE>, and <!$MGENDIF> tags must match.

<!$MGELSE> tags may only be placed between a pair of <!$MGIF_name> and <!$MGENDIF>.

REPEAT and IF-ELSE-ENDIF blocks can be nested.

Related Topics

Reference
Attachment 
Attachment