CustomFieldCreate

Use this node to create a custom field on a Salesforce object.

Asset Type Name for Rules 

CustomField

Example Definition in chain.json 

1{
2  "name": "create_contact_custom_field",
3  "label": "Create Contact Custom Field",
4  "dominoVariant": "sfdc_internal__UnifiedAnalyticsDominoVariant",
5  "parameters": {},
6  "definition": {
7    "nodes": {
8      "Create_Custom_Field_Variables": {
9        "graphNodeType": {
10          "name": "CustomFieldCreate"
11        },
12        "parameters": {
13          "objectName": "${Variables.objectName}",
14          "description": "${Variables.description}",
15          "fieldType": "${Variables.fieldType}",
16          "fieldName": "${Variables.fieldName}",
17          "fieldLabel": "${Variables.fieldLabel}",
18          "fieldLength": "${Variables.fieldLength}",
19          "condition": "${true}"
20        },
21        "sources": [],
22        "runAs": "CurrentUser"
23      }
24    }
25  }
26}

Parameters 

ParameterDefinition
objectName(Required) The API name of the Salesforce object to add the custom field to, such as Contact or Account.
fieldName(Required) The API name for the custom field.
fieldLabel(Required) The label for the custom field.
fieldType(Required) The data type of the field, such as Text, Number, or Checkbox.
fieldLength(Optional) The length of the field, applicable to text fields only.
description(Optional) A description of the custom field.
condition(Optional) An EL expression, evaluated at runtime, that determines whether to create this custom field or not.

Set runAs to CurrentUser so that this node runs with the permissions of the user installing the app. If you omit runAs, the node runs as AutoProc, a system user.

Note

App Context Values 

App Context ValueDefinition
App.CustomFields.<template specific asset name>.IdThe ID of the created custom field.
App.CustomFields.<template specific asset name>.NameThe API name of the created custom field.

On Failure 

If this task fails, it returns a FAIL_TERMINAL status. The chain stops and no downstream nodes run.

See Also