You can choose where a custom field is shown and how it looks. For example, show a PO number on the right side of the invoice, a note below the invoice, or the delivery time right under the Buy now button of a store item.
The custom fields page
Go to Settings > Setup > Custom fields. The list on the left shows every place you can add fields to, in groups (Clients & leads, Sales, Projects & work, Team), with the number of fields in each place. Click a place to see its fields.
Each field shows its input as it looks in the forms, with the options of list fields, and below it the settings that are turned on: visibility options, where it is shown (for example Show in table, Add filter or Below the buy button) and its template variable name. Drag a field to change the order. On a phone, pick the place from the dropdown.
Add or edit a field
The field window has these groups of options, split by a line:
- Title, field type, options and placeholder.
- Required, add filter, show in table, show on kanban card, show in embedded form.
- Visible to admins only, hide from clients, disable editing by clients.
- The documents (invoice, estimate...) and the extra places of the page where the value is shown.
- Label, style and icon. Available for the fields of every module.
- Title and placeholder language keys, template variable name.
Places you can choose
| Fields of | Place | Where it shows |
| Invoices | Invoice right panel | In an "Additional info" card on the right side of the invoice details page. |
| Invoices | Below the invoice | Below the totals and note on the invoice preview, public preview and PDF. |
| Items | Below the description | Under the short description on the store item page. |
| Items | Below the buy button | Right under the Buy now / Add to cart button. |
| Items | Item info list | The info list at the bottom of the buy panel. Item fields made before this update are shown here. |
| Items | Details tab | Below the content in the Details tab. |
A field can be shown in more than one place. Empty values are not shown.
Display options
- Label: turn it off to show only the value, for example a short note under the buy button.
- Style: List (label left, value right), Stacked (label above the value) or Highlighted box (a soft box for notes and notices).
- Icon: an icon before the field (inside the box for the Highlighted box style). Choose None for no icon. Fields that were never saved with these options keep their old icons on the details pages.
These options work everywhere the field value is shown: the details pages (client, lead, project, task, ticket, expense, event, item...), the info cards of estimates, contracts, proposals and subscriptions, the documents (invoice, estimate, order, contract, subscription, client statement) and the places above. Fields saved before this update keep the old look (label on, List style, no icon). Lists, tables and kanban cards stay compact and don't use these options.
In documents (preview and PDF), icons are not shown, and the styles are kept simple: Stacked shows a small gray label above the value, Highlighted box shows the field on a soft gray background.
Visibility
- A field that is visible to admins only is shown only to admins, also on these places.
- A field hidden from clients is not shown on the store page or on the invoice preview and PDF, because clients can see them.
For developers: add your own place
A plugin can add places with the filter app_filter_custom_field_positions and show the fields with Custom_field_display::render().
app_hooks()->add_filter('app_filter_custom_field_positions', function ($positions, $related_to) {
if ($related_to === "projects") {
$positions["my_plugin_project_sidebar"] = array(
"title" => "my_plugin_project_sidebar", //language key
"description" => "my_plugin_project_sidebar_description" //optional language key, shown under the switch
);
}
return $positions;
}, 10, 2);
//in your view: load the fields with the user's visibility, then render the place
$fields = model("App\Models\Custom_fields_model")->get_combined_details("projects", $project_id, $login_user->is_admin, $login_user->user_type)->getResult();
echo \App\Libraries\Custom_field_display::render($fields, "my_plugin_project_sidebar");
For a PDF, pass array("pdf" => true) as the third parameter to get simple inline styles. To show a single field with its label, style and icon (for example in your own details view), use Custom_field_display::render_field($field); pass array("document" => true) for a document/PDF, "bold_label" => true for a bold label. Pass "type_icon" => true to show the field type icon for fields never saved with display options. The filter app_filter_custom_field_contexts can add a new place to the list on the custom fields page.