refresh()
Last updated 21/01/2026
Definition
The
Examples
The following functions demonstrate how you can use the
Refresh a field due to status
This code checks the value of the Status field on the current page. If the status is Pending, it logs a message to the Five Inspector, refreshes the page to get the latest data, and then logs another message indicating that the refresh is complete.
const page = five.sender();
const statusField = page.getField("Status");
if (statusField.getValue() === "Pending") {
five.log("Status is pending, refreshing page...");
page.refresh();
five.log("Page refreshed with latest data");
}
Refresh before reading fields
This code gets the current form page, refreshes it to make sure the data is up-to-date, then reads the values of the ApprovalStatus and Comments fields, and logs them to the Five Inspector.
const page = five.sender();
page.refresh();
const approval = page.getField("ApprovalStatus").getValue();
const comments = page.getField("Comments").getValue();
five.log("Approval:", approval);
five.log("Comments:", comments);
Conditional refresh based on tab type
This code checks which type of tab the current form page is on, either a Form or a List page. If it's a Form tab, it displays a message in the UI and refreshes the page to ensure the data is up-to-date. If it's a List page type, it displays a message and does nothing.
const page = five.sender();
if (page.getTabType() === "F") {
five.showMessage("Form page detected, refreshing page for the latest data...");
page.refresh();
} else {
five.showMessage("List page detected, no refresh needed");
}
Refresh only if a checkbox is checked
This code checks a Boolean (checkbox) field on the current form page to decide whether the page needs to be refreshed. If the checkbox is checked, it refreshes the page to reload the latest data.
const page = five.sender();
const checkField = page.getField("NeedsRefresh");
if (checkField.getValue() === true) {
five.log("Checkbox checked, refreshing page...");
page.refresh();
}
Using the optional includeParents parameter
This code retrieves the current form page and performs a full refresh that includes both the current page and its related parents. After completing the refresh, it logs a confirmation message to the Five Inspector.
const form = five.sender();
// Refresh this page and any parents
page.refresh(true);
five.log("Current page and parents have been refreshed");