---
title: "Updates"
description: "API documentation detailing update operations using GraphQL. Highlights use of filter/value pairs and filters/values pairs, with examples."
lang: en
languages:
  en: https://docs.vismasoftware.no/businessnxtapi/apireference/schema/mutations/updates/index.md
lastmod: 2026-07-10
---

> Documentation index: https://docs.vismasoftware.no/businessnxtapi/apireference/schema/mutations/llms.txt


# Updates

Last modified July 10, 2026

> API documentation detailing update operations using GraphQL. Highlights use of filter/value pairs and filters/values pairs, with examples.


Update operations are available through a field having the name of the form `<tablename>_update` of a type having the name of the form `<parenttype>_<tablename>_Result`. For instance, for the `Associate` table, the field is called `associate_update` and its type is `Mutation_UseCompany_Associate_Result`. The result type is the same for inserts, updates, and deletes.

The form of this operation is the following:

```graphql
associate_update(
   filter: FilterExpression_Associate
   value: Associate_Input
   filters: [FilterExpression_Associate]
   values: [Associate_Input!]
): Mutation_UseCompany_Associate_Result
```

The `<tablename>_update` field has two pairs arguments, that you must use together. The first pair is:

- An argument called `filter` which defines the selection filter for the records to be updated. The type of this argument is the same used for filters in queries and will be described in details later in the document.
- An argument `value` which is an object of type `<tablename>_Input`. For instance, for the `Associate` table, the input type is `Associate_Input`. This is the same input type used for insert operations for tables with a single primary key column. For tables with more than one primary key columns, it's a type slightly different than the one used for inserting, none of the primary key columns being available for updating.

You can use this if you want to update all records matching the filter with the same values. If you want to update each (or different) record with a different value, you must use the second pair of arguments:

- An argument called `filters` which is a list of filters, one for each record to be updated. The type of the elements of `filters` is the same used as the type of `filter.
- An argument called `values` which is a list of objects of type `<tablename>_Input`.

> [!NOTE]
>
> The `filter` \ `value` pair is considered deprecated and will be removed in the future. You should use the `filters` \ `values` pair instead.

An update operation has the following form (in this example, we set the `languageNo` field to 44 for all associates that have the `associateNo` field greater than 546):

```graphql { title = "Query" }
mutation update_lang($cid : Int!)
{
  useCompany(no:$cid)
  {
    associate_update(
      filter : {associateNo : {_gt : 546}},
      value:{languageNo:44})
    {
      affectedRows
      items
      {
        associateNo
        customerNo
        name
        shortName
        languageNo
      }
    }
  }
}
```

```graphql { title = "Result" }
{
  "data": {
    "useCompany": {
      "associate_update": {
        "affectedRows": 2,
        "items": [
          {
            "associateNo": 547,
            "customerNo": 30101,
            "name": "Erik Larson",
            "shortName": "Erik",
            "languageNo": 44
          },
          {
            "associateNo": 548,
            "customerNo": 30102,
            "name": "Frida Olson",
            "shortName": "Frida",
            "languageNo": 44
          }
        ]
      }
    }
  }
}
```

You can collect multiple edits in a single update operation. You can do that with the use of `filters` and `values`. The following examples shows how to update multiple lines of an order with the different values. One filter and one value are provided for each line:

```graphql
mutation multi_order_line_update($cid : Int!, $ono : Int!)
{
  useCompany(no : $cid)
  {
    orderLine_update(
      filters: [
        # filter for line 1
        {_and:[
            {orderNo : {_eq : $ono}}
            {lineNo : {_eq : 1}}]},
        # filter for line 2
        {_and:[
            {orderNo : {_eq : $ono}}
            {lineNo : {_eq : 2}}]}
      ]
      values: [
        # value for line 1
        {
          priceInCurrency : 199.99,
          invoiceNow : 1.0
        },
        # value for line 2
        {
          priceInCurrency : 59.99,
          invoiceNow : 1.0
        },
      ])
    {
      affectedRows
      items
      {
        orderNo
        lineNo
        quantity
        priceInCurrency
        invoiceNow
      }
    }
  }
}
```

You can transform any query using `filter` and `value` into a query using `filters` and `values`. An example is the following query:

```graphql { title = "filter & value" }
mutation update_lang($cid : Int!)
{
  useCompany(no:$cid)
  {
    associate_update(
      filter : {associateNo : {_gt : 546}},
      value:{languageNo:44})
    {
      affectedRows
      items
      {
        associateNo
        customerNo
        name
        shortName
        languageNo
      }
    }
  }
}
```

```graphql { title = "filters & values" }
mutation update_lang($cid : Int!)
{
  useCompany(no:$cid)
  {
    associate_update(
      filters : [{associateNo : {_gt : 546}}],
      values: [{languageNo:44}] )
    {
      affectedRows
      items
      {
        associateNo
        customerNo
        name
        shortName
        languageNo
      }
    }
  }
}
```

>[!TIP]
>
> If the `values` (or `value`) argument is empty, `[{}]` (or `{}`), no object is updated and `affectedRows` is 0. However, if you ask for `items`, a read operation is performed and the items matching the filter(s), if any is specified, or all otherwise, are returned.

## Error handling

The same mechanism for error handling used for insert operations with the `onError` argument is used for updates too.

See [Inserts - Error handling](https://docs.vismasoftware.no/businessnxtapi/apireference/schema/mutations/inserts/index.md#error-handling) for details.

>[!NOTE]
>
> In case of a failed row update (when using `FAIL_ROW` or `FAIL_TABLE` error handling policies), the `items` field (if requested) will return, for the failed row, the values of the row before the update operation.
Every failed row is indicated, with a descriptive message and a reference path, in the `errors` array of the response.

---

[View this page](https://docs.vismasoftware.no/businessnxtapi/apireference/schema/mutations/updates/)
