Skip to content

Templates

Verified against source (3)

  • Interfaces/ITemplate.cs
  • application/Enumerations.cs
  • application/GenericObject.cs

Template classes (for example DecisionTemplate, AttachmentTemplate, MessageTemplate, ProcessTemplate) implement ITemplate:

Member Purpose
AppliesTo Table name that templated records may attach to (their Object).
Repeatable Repeatability enum: how many templated records a parent may have.
CustomStatusList / CustomTypeList When true, status/type lists are driven by the template instead of the record type.
ExtranetEnabled Extranet enum: whether and how templated records join row-level partner security.
IdLookup(name) Resolves a template name to its ID (cached).
CreateInstance(parent, parameters) Creates a record from the template under a parent.
public enum Repeatability { One = 0, OneActive = 1, Many = 2 }

OneActive counts only records whose status is not a final status.

public enum Extranet { None, Self, Family, Template }

Template: access is controlled by users having access to the template; no direct access to the instance is required.

When a templated record is saved without an ID and with a Template (or TemplateID, {Table}Template, {Table}TemplateID), GenericObject.SetProperties runs SelectByTemplate before inserting:

  • Existing parent (Object + ObjectID): SelectByTemplate looks for a record that the template’s Repeatable rule says should be reused. If found, the existing record is selected and the new properties are merged into it — the save becomes an update. With Many, nothing is reused and a new record is inserted.
  • New parent created in the same call (Object set, no ObjectID, parent properties supplied): the parent is being inserted, so repeatability can’t conflict; SelectByTemplate still applies the template’s defaults (such as the record’s name).
  • SelectByTemplate=0 skips the lookup entirely — including template defaults — so it isn’t a way to force a new record. Use Repeatable = Many on the template instead.

Parent properties are read from parameters prefixed with the parent’s object name, {Object}_. Nested collections use {Object}_{Collection}_{index}_{Field}. For example, a web form that creates an organization, a contact on it, and a workflow under it in one request:

POST /api/decision/save
?Template=QMS Demo Request
&Object=Organization
&Organization_Organization=Acme Lending
&Organization_Email=info@acme.example
&Organization_Contacts_0_FirstName=Ada
&Organization_Contacts_0_LastName=Lovelace
&Organization_Contacts_0_Email=ada@acme.example
&Output=Xml

The XML response contains the new DecisionID and the parent’s ObjectID. (JSON output omits the record’s data fields; use Output=Xml when you need IDs back.)