Skip to main content

Custom fields

Fields your company adds to any kind of record, without anybody changing the software. Settings → Custom fields.

Permissions​

custom_field.readSee which fields are defined. Granted to every role.
custom_field.manageAdd, change and retire them. Manager and above.

Reading is deliberately not administrative: "why is this form asking me that" is a fair question, and the answer is on this screen.

A field's values are governed by the record's own permissions, not by these. Somebody who can read an order can read its custom fields; somebody who cannot cannot, whichever fields exist.

Choosing a name in the data​

The label is cosmetic and can be reworded whenever you like. The name in the data cannot be changed at all, and it is worth a minute's thought:

  • it is the column heading in every CSV export and the heading an import file must use;
  • it is the key in the API and in any integration somebody builds later;
  • every value already saved is filed under it.

Lower case, underscores, specific: customer_po, rep_code, lab_tested.

It may not be the name of a field the record already has. A product already has a volume_ml, a sku and a net_weight_g; a custom field of the same name would be a second place to type the same fact, and nobody filling in a form can tell which of the two a report or a tax reads. The form refuses it and says which: "volume_ml is already a field on items, built in … Use that one, or choose another key." Use the built-in field, or pick a name that says what is different about yours (fill_volume_ml).

The kind is likewise fixed. Values saved as text are not numbers, and changing the type would leave every existing one failing validation.

If either is wrong, the answer is a new field and a data migration — which is an export, an edit and an import.

Kinds​

KindStored asNotes
Text, Long textstring
NumberstringA string on the wire, because JSON numbers are floats
Amount{amount, currency}Needs a currency on the definition
Yes or noboolean
Date, Date and timeISO string
One choice, Several choicesthe option's valueReword a label freely; the value is what is stored
Personuser idA picker listing everybody who works here
Web address, Email addressstringValidated on the way in

Required fields​

A required field must be filled in on every record of that kind, including ones created by an import or by an integration. Make a field required only when that is genuinely true — a required field added to a busy record type is a morning of failed imports.

Retiring​

There is no delete, and this is the part to explain to whoever asks for one.

Switching a field off removes it from every form and leaves everything already recorded readable — in exports, in a record's history, and to an auditor. Deleting the definition would leave values on hundreds of records with nothing to say what they meant.

Switching it back on restores the field with all its data.

Two exceptions, both for a field the record now has built in:

  • A field whose name in the data is now the name of a built-in field cannot be switched back on, on any record. The refusal names the field.

  • The three product fields that held what is in the package cannot be switched back on either: e-liquid volume (volume_ml), ounces per product (ounce_per_product) and cigarettes per unit (cigarettes_per_unit). Net contents are recorded on the product itself now, those three were switched off when that arrived, and their values were carried over. Only the first of the three shares its name with a built-in field; all three are refused, because each was marked when it was switched off, and editing the field does not remove the mark. The refusal says which built-in field took over:

    Field switched offUse instead
    volume_ml (E-Liquid Volume)Net volume (net_volume_ml)
    ounce_per_productNet weight (net_weight_g), in grams
    cigarettes_per_unitUnits per package (units_per_package)

    Their old values are still on each record and still export.

The server sends that sentence. The Custom fields page shows its general "That field could not be saved." for any refused change, so the table above is where to look.

One consequence to know about until excise is changed to read the built-in fields: a company that set up Pennsylvania's cigarette tax before this change taxes cigarettes by the number typed into cigarettes_per_unit. Products that already have it are taxed as before. A new cigarette product cannot be given one, because the field is off and stays off, and the tax does not read Units per package yet — so it cannot be taxed per stick until that change arrives.

Interaction with other features​

Import and export carry custom fields as ordinary columns, headed by the name in the data.

Saved views can filter on them.

The assistant can read them, subject to the record's own permissions.

Uninstalling an app removes the records that app owned and the field definitions on them — the values go with the records, and the definitions go too, because a definition describing a record type that no longer exists here describes nothing. Reinstalling gives you the app back with no fields; export first if you want a record of what you had.

Start with none. Add a field when somebody has asked twice for the same thing, and put the ones people use at the top: a form with forty extra boxes is a form nobody fills in.