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 | null )

Parameters

string name
    The name of the template.

Xml node optional
    Optional XML node used for data binding. When omitted, the server returns the stored subject without formatting it.

Returns

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

Examples

Format the subject of a template

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