Skip to main content
Skip table of contents

create

Creates a new record of the specified type with field values as defined by child commands. This creation needs to follow all requirements and restrictions of records of that object type, or otherwise the operation fails.

Child Commands

  • field

    Optional. Each field child defines one field value for the created record. With certain object types certain fields are required to have values, therefore making field child commands required in these cases.

Attributes

type

 

 

Required

Value type

EL-evaluated

Yes

String

No

Defines the object type of the created record. The resolved String should be the API name of an object type.

The create command needs to be used with field commands as its children to define field values for the new record. Be sure to define all required fields and use values of kinds matching the field types, eg. DateTime value for Date/Time field. To set references, use the referenced record's Id as the value.

CODE
<create type="Custom_Object__c">
  <field name="Name" value="A custom record">
  <field name="Opportunity__c" value="${mainOpportunity.Id}">  

If creating multiple records of the same type, use the batch command to lessen the amount of API requests and speed up the process.

CODE
<batch>
  <forEach value="${newRecordsData}" var="newRecordData">
    <create type="Secret_Item__c">
      <field name="Name" value="${newRecordData.name}">
      <field name="Code__c" value="${newRecordData.secretCode}"> 
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.