Skip to main content
Version: 1.x

Function: deleteEntity()

deleteEntity(page, serviceUrl, entitySet, key, options?): Promise<void>

Ai

Deletes an entity via HTTP DELETE.

Parameters​

page​

ODataHttpPage

Playwright Page with request API.

serviceUrl​

string

OData service root URL.

entitySet​

string

Name of the entity set.

key​

string

Entity key including parentheses, e.g. "('123')".

options?​

ODataHttpOptions

HTTP options including required CSRF token.

Returns​

Promise<void>

Capability​

ui5.odata.deleteEntity

Intent​

Remove an OData entity by sending a DELETE request to the service.

Guarantee​

On success, the entity is deleted and the HTTP response status is 2xx.

Ai Context​

Uses Playwright's request API to DELETE the entity. Requires a CSRF token. No response body is returned on successful deletion.

Sap Module​

sap.ui.model.odata.v2.ODataModel — HTTP-level entity deletion

Business Context​

Delete business entities (e.g., cancel draft documents, remove test data).

Throws​

ODataError with ERR_ODATA_CSRF if CSRF token is missing.

Throws​

ODataError with ERR_ODATA_REQUEST_FAILED on HTTP error.

Example​

await deleteEntity(page, '/sap/opu/odata/sap/SVC/', 'Products', "('123')", {
csrfToken: token,
});