salesforce_create_custom_field
Create custom fields on Salesforce objects using the Tooling API, supporting standard types like Text, Number, Picklist, and Lookup.
Instructions
Create a custom field on a Salesforce object using the Tooling API. Supports all standard field types including Text, Number, Picklist, Checkbox, Date, Lookup, and more.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Number of decimal places for Number/Currency/Percent fields (default 0) | |
| length | No | Field length. For Text: 1–255 (default 255). For LongTextArea/RichTextArea: up to 131072 (default 32768). Not used for Date, Checkbox, etc. | |
| unique | No | Whether the field value must be unique (default false) | |
| formula | No | Formula expression for Formula fields | |
| required | No | Whether the field is required (default false) | |
| fieldType | Yes | Salesforce field type. One of: Text, Number, Currency, Picklist, MultiSelectPicklist, Checkbox, Date, DateTime, Email, Phone, URL, TextArea, LongTextArea, RichTextArea, Lookup, MasterDetail, Percent, AutoNumber, Formula | |
| precision | No | Total number of digits for Number/Currency/Percent fields (default 18) | |
| fieldLabel | Yes | Human-readable field label (e.g. 'Customer Tier') | |
| objectName | Yes | Salesforce object API name (e.g. 'Account', 'My_Object__c') | |
| description | No | Internal description of the field's purpose | |
| referenceTo | No | Target object API name for Lookup or MasterDetail fields (e.g. 'Account', 'My_Object__c'). Required for Lookup/MasterDetail types. | |
| defaultValue | No | Default value for the field. For AutoNumber fields, this sets the display format (e.g. 'CASE-{000000}') | |
| fieldApiName | Yes | Field API name without the __c suffix (e.g. 'Customer_Tier'). The __c suffix will be added automatically. | |
| visibleLines | No | Number of visible lines for LongTextArea/RichTextArea fields (default 5) | |
| inlineHelpText | No | Help text shown to users in the UI | |
| picklistValues | No | List of picklist values for Picklist or MultiSelectPicklist fields (e.g. ['High', 'Medium', 'Low']) | |
| relationshipName | No | Relationship name for Lookup/MasterDetail fields. Auto-generated if not provided. |