Skip to main content
Version: 1.x

Function: hasPendingChanges()

hasPendingChanges(page, options?): Promise<boolean>

Ai

Checks whether the UI5 OData model has unsaved (pending) changes.

Parameters

page

ODataPage

Playwright Page (or compatible subset).

options?

ODataOptions

OData options (modelName).

Returns

Promise<boolean>

true if the model has pending changes, false otherwise.

Capability

ui5.odata.hasPendingChanges

Intent

Check if the OData model has unsaved changes (dirty state).

Guarantee

Returns true if model.hasPendingChanges() is true, false otherwise (including when model is not found).

Ai Context

Calls model.hasPendingChanges(). Useful to verify before navigating away or to assert that edits have been properly saved.

Sap Module

sap.ui.model.odata.v2.ODataModel, sap.ui.model.odata.v4.ODataModel

Business Context

Detect unsaved changes before navigation to prevent data loss warnings.

Example

const dirty = await hasPendingChanges(page);
if (dirty) {
logger.warn('Model has unsaved changes');
}