Skip to main content
An object is a kind of record, and a field is one piece of information on it. A manifest declares both with defineObject and defineField.

Declare an object with defineObject

An object needs an id, API names, labels for people, and its fields. The API name and the id are separate on purpose. An object can be renamed later without breaking anything, because everything else points at the id.

Declare a field with defineField

The built-in types are text, rich_text, number, money, currency, boolean, date, date_time, select, multi_select, email, phone, url, relation, member and json. A module can add its own, as the CRM does with a star rating. See Field and view types.

Declare a relation

A relation field points at a record of another object. Declare it on the object that holds the link, such as a deal’s company, and name the target object by its id.
many_to_one means many deals can point at one company. inverseLabel is the heading of the list of deals on the company’s page: relations are what let a record page show related records.

Add fields to someone else’s object

A module can add fields to an object that another module owns. List the field at the top level of your manifest, with the other object’s id as its objectId. The field belongs to your module, and it is removed with it. Keep every id in one ids.ts, so the manifest, the server code and the tests refer to the same names. A small module can use a flat list, as in Create a first module. A larger module groups ids by kind, as the CRM does: ids.objects.project, ids.fields.project.name.