Skip to main content

isCreate()

Last updated 13/01/2026

Definition​

The

is a function on the

Form
object that returns a boolean to let you know whether the form is currently being used to create a new record.

Examples​

The following functions demonstrate how you can use the

isCreate()
function on the
Form
object.

Checking if the the form is creating a new record​

This code is checking whether the form is in create mode and logs the result to the Five Inspector.

JavaScript
Checking if the form is being created and logs the result to the Five Inspector
const form = five.sender();

if (form.isCreate()) {
five.log("Creating a new record");
}

Combine with an event​

This code gets the current form, then checks when it is shown if the form is being used to create a new record and logs the result to the Five Inspector.

JavaScript
Combining isCreate() with an event
const form = five.sender();

if (form.isCreate() && form.event() === "OnShow") {
five.log("New record form is being created");
}

Combine with actionID()​

This code checks whether the current form is creating a new record and was opened in create mode and runs logic only for the

CreateMeasurement
action ID.

JavaScript
Combining isCreate() with actionID()
const form = five.sender();

if (form.isCreate() && form.actionID() === "CreateMeasurment") {
five.log("Measurement create action detected");
}

Prevent logic running during edits​

This code checks whether the form is being opened in edit mode, and if so, skips the

isCreate()
logic and logs a message to the Five Inspector explaining why.

JavaScript
Checks the form is not create and prevents running new record logic
const form = five.sender();

if (!form.isCreate()) {
five.log("Skipping logic because this is an edit");
}