Element Structure Definition

Template element structure closely resembles service element structure:

  1. It defines a tree-like hierarchy of elements
  2. Is stored as an XML rather than Salesforce objects
  3. Elements can be of ‘new’ or ‘existing’ types: new objects are always created fresh (create & set attributes), existing ones are specified by an element object Id
  4. New elements may have attributes specified as name-value pairs
  5. Service name can be used as a wildcard in attribute values using [Service::Name] syntax
Service template elements
Service template elements

The template XML syntax is explained below:

<service> <!-- beginning of service definition, contains a list of <element> items --->
   
    <!-- new element -->
    <element type="new">
        <!-- these fields will be populated (this is 100% dynamic, custom fields may be included) -->
        <field name="Name" value="/29 IP Block" /> <!-- developer field name and value -->
        <field name="Type__c" value="IP Block" />
        <field name="Managed__c" value="false" />
        <field name="MRC__c" value="8.60" />
    </element>

    <!-- new type element -->
    <element type="new">
      <field name="Name" value="ACCESS-[Service::Name]" /> <!-- generate name using service name wildcard -->
      <field name="Type__c" value="Network Access" />
      <field name="Managed__c" value="false" />
      <field name="MRC__c" value="226.00" />
      <field name="Provider__c" value="0017F00000O7oc4QAB" /> <!-- assign lookup via object id (type must match) -->
    </element>
    
    <!-- existing element, via object id, must be Element__c -->
    <element type="existing" id="a027F00000Y3PAUQA3" />
</service>
Important Tip  When creating a new template it is best to create it from an existing service.
Was this page helpful?