Document toolboxDocument toolbox

Custom fields

Custom fields are user-defined additional fields which may be added to various object types.

Custom fields may come and go, ie. a custom field can deleted at any time, and new custom fields may be created at any time. Custom fields are recognised by their name, which starts with custom followed by a number (the custom field ID), eg. custom34.

Use GetCustomFields to retrieve details about the custom fields for each type of object. The API call will return a list of customfield objects for each object type.

Visibility

If f.ex. a custom field belongs to an equipment, then it may be visible only for equipments of a certain type. F.ex. you may have equipments of type “Car” and other equipment of type “Machinery” so if you have a custom field name “Licenseplate” then it makes sense to make it visible only for the equipment type “Car”. The visibility field in the customfield object specifies the type IDs for which the field should be visible. Notice that the type field differs depending on the type of object, f.ex. for todos the type field is actually the field workareaid, whereas for equipment it is the field groupid.

Example: A custom field X for todos/tasks has the visibility field set to include the IDs 3, 4, 5 and 6. A task has the workareaid field set to 5. So the custom field X should be displayed for this task, as 5 is included in the list of IDs.

Object typeField which determines visibility
todoworkareaid
toolsgroupid
customerstypeid
usersusertypeid
persontypeid


Types


typedescriptiondata typeformatted typeexample
1textstringstringSome text
2checkboxbooleanboolean0 or 1
3dropdownsetstring['Blue','Green','Red'], the value of the field is a value from the set, eg. 'Blue'
4numbernumbernumber123
6datedatedate2019-02-21
7multichecksetstring[1,2,3,4], the value of the field is a collection of values from the collection, eg. [2,4]
8longtextstringstringline breaks are specified as \n
9usernumberstring3 (the ID of a user)
10iconnumberstring3 (the ID of an icon, see GetIcons)
11URLstringstringhttp://www.microbizz.dk/
12customernumberstring123 (the ID of a customer)
13colourstringstring#ff0000
14indexedmenusetstringshould not be supported in current versions of the app
15timetimetime12:30:43
16addresssetstringcontains the fields name,adress,adress2,zip,city,country,lat,lon
17comboboxstringstringa combobox is like a text box but also includes predefined values which are likely to be used
18teamnumberstring5 (the ID of a team, see GetTeams)
19icon urlsetstringshould not be supported in current versions of the app
20personnumberstring51 (the ID of a user)

The subtype field in the customfield object applies to custom fields of type 1=text. The value can be either: 0=plain text, 1=phone number, 2=email, 3=readonly text. It should not be possible to edit fields with subtype 3=readonly text.

If the showinapp in the customfield object is 0 then the field is never visible in the app.

The custom fields for an object are transferred together with the other fields for the object; the custom fields are named customXX where XX is the ID of the custom field, so if the todo object has an custom field with the ID 34, then the todo object will include a field named custom34 which holds the formatted value. The raw, unformatted values are specified in a field named _rawcustom34.

F.ex. an address custom field with the ID 34 will be included as two fields named custom34 and _rawcustom44. custom34 may hold the string 23 Wall Street, NY whereas _rawcustom34 holds a set with some of the fields name,adress,adress2,city,zip,country,lat,lon, f.ex. (in JSON format) : { “adress”:“23 Wall Street”,“adress2”:“Third floor”,“city”:“NY”,“country”:“US” }.