Praman — Agent-First SAP UI5 Test Automation Plugin - v1.2.0
    Preparing search index...

    Function updateEntity

    • Ai

      Updates an existing entity via HTTP PATCH.

      Type Parameters

      • TData = unknown

      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')".

      • data: unknown

        Partial entity data to update.

      • Optionaloptions: ODataHttpOptions

        HTTP options including required CSRF token.

      Returns Promise<ODataHttpResult<TData>>

      The updated entity with HTTP status and optional ETag.

      ui5.odata.updateEntity

      Update an existing OData entity by sending a PATCH request with partial data.

      On success, the entity is updated and the response contains the updated entity data.

      Uses Playwright's request API to PATCH the entity. Only changed fields need to be provided. Requires a CSRF token. ETag is returned for optimistic concurrency control.

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

      Update existing business entities (e.g., change PO quantity, update product price).

      ODataError with ERR_ODATA_CSRF if CSRF token is missing.

      ODataError with ERR_ODATA_REQUEST_FAILED on HTTP error.

      const result = await updateEntity(page, '/sap/opu/odata/sap/SVC/', 'Products', "('123')", {
      Price: 50,
      }, { csrfToken: token });