getDataManager()
Last updated 20/01/2026
Definition
The getDataManager() is a function on the
FormPage
object
that returns a DataManager
object associated with the FormPage
.
Examples
The following functions demonstrate how you can use the
getDataManager()
function on the FormPage
object.
Get the DataManager for the current page
This code retrieves the
DataManager
associated with the current page, which manages record, data, state, and persistence for the form.
Accessing the data context backing the current form page
const page = five.sender();
const dataManager = page.getDataManager();
five.log("DataManager retrieved", dataManager);
Read a field value via the DataManager
This code retrieves data from the current form page
DataManager
and logs a specific field value.
Retrieve and log a data value using the form page DataManager
const page = five.sender();
const dm = page.getDataManager();
const customerName = dm.getValueByName("CustomerName");
five.log ("Customer Name:", customerName);
Set a field value programmatically
This code updates a data value on the current form page using the
DataManager
.
Update a form page's data value using the DataManager
const page = five.sender();
const dm = page.getDataManager();
const customerName = dm.setValueByName("Status", "Pending Approval");
Validate data before saving
This code retrieves the current form page, accesses its
DataManager
, and validates the value of an Amount field. If the amount is zero or negative, it shows a message to the user
and clears the field.
Ensure amount value is greater than zero
const page = five.sender();
const dm = page.getDataManager();
const amount = dm.getValueByName("Amount");
if (amount <= 0) {
five.showMesage("Amount must be greater than zero");
dm.setValueByName("Amount", null);
}