Skip to content

Subject

Retrieves the subject of a template by its name, optionally using an XML node for data binding.

1
$Templates.Subject(name: string, node: Xml):string

Parameters

string name
    The name of the template.

Xml node
    The XML node to use as input for data binding. Optional. If not specified, the global $Xml instance is used.

Returns

The template subject as a string if found; otherwise, null.

Remarks

Example

1
2
3
// if template subject is set to "Purchase order {{Number}}"
var result = $Templates.Subject('Purchase Order', $Xml.SelectSingle('Order'))
// result contains the "Purchase Order 12345"

See Also