Create a custom field

distru-create-custom-fieldWrite

Adds a custom field to one entity type, e.g. a Lab dropdown on packages; it then appears on every record of that type.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
entityTypeenum
ASSEMBLYBATCHCOMPANYCONTACTINVOICEPACKAGEPRODUCTPURCHASE_ORDERRETURNSALES_ORDERSTOCK_TRANSFERTASK
Yes
namestringYesUp to 70 characters; unique within the entity type.
fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
YesDATE: a day, no time. DROPDOWN: one option. CHECKBOX: any number of options. Cannot be changed later.
descriptionstringNoUp to 100 characters.
requiredbooleanNoMust be filled in on every record.
optionsstring[]NoRequired for DROPDOWN and CHECKBOX, not allowed otherwise. Unique; no commas.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
customFieldobjectAlways
customField.idstringAlways
customField.namestringAlways
customField.descriptionstringCan be null
customField.entityTypeenum
ASSEMBLYBATCHCOMPANYCONTACTINVOICEPACKAGEPRODUCTPURCHASE_ORDERRETURNSALES_ORDERSTOCK_TRANSFERTASK
Can be null
customField.fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
Always
customField.requiredbooleanAlways
customField.optionsobject[]Always
customField.options[].namestringAlways
customField.options[].disabledbooleanAlways
What the AI reads

Adds a custom field to one entity type, e.g. a Lab dropdown on packages; it then appears on every record of that type. It defines the field only: it sets no value on any record. Check distru-search-custom-fields first so you don't add a field that already exists; to change one use distru-update-custom-field. Requires the custom fields settings permission.