Model information

Query model information using useModel to retrieve details on tables, columns, relations, domains, processings, reports, and folders.

Overview

You can query information from the data model. This is possible using the useModel field in the top-level query. This allows to retrieve information about the following entities:

  • tables
  • columns
  • relations
  • domains and domain members
  • processings
  • reports
  • folders

You can query the core model only, the extension model only, or both models together.

The information that is available for each entity include:

  • primary key (such as tableNo for tables, columnNo and tableNo for columns, etc.)
  • identifier, which is a language-independent name of the field; this is what the GraphQL schema uses for entity names
  • name, which is a language-specific name for the entity
  • access restrictions and availability

In addition, each type of entity has it’s own specific fields.

The languages supported for translations are:

  • English (this is the default, if no language is specified)
  • Norwegian
  • Swedish
  • Danish

Examples

Here is an example for fetching table information: ID, identifier, name in Norwgian, and the database type it belongs to (which can be either COMPANY or SYSTEM) for all the existing tables in the core model:

Query
query get_tables_info
{
  useModel(lang: NORWEGIAN)
  {
    tables
    {
      tableNo
      name
      identifier
      databaseType
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "tables": [
        {
          "tableNo": 1,
          "name": "Arbeidsområde­vindu",
          "identifier": "WorkspaceWindow",
          "databaseType": "SYSTEM"
        },
        {
          "tableNo": 2,
          "name": "Arbeidsområde­element",
          "identifier": "WorkspacePageElement",
          "databaseType": "SYSTEM"
        },
        # ...
        {
          "tableNo": 457,
          "name": "Inngående betalingslinje",
          "identifier": "AutopayVipPaymentLine",
          "databaseType": "COMPANY"
        },
        {
          "tableNo": 458,
          "name": "Inngående betaling ekstratekst",
          "identifier": "AutopayVipTextInfo",
          "databaseType": "COMPANY"
        }
      ]
    }
  }
}

On the other hand, it’s possible to ask for this information for a specific table by specifying the table number:

Query
query get_table_info
{
  useModel(lang: NORWEGIAN)
  {
    tables(tableNo : 152)
    {
      tableNo
      name
      identifier
      databaseType
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "tables": [
        {
          "tableNo": 152,
          "name": "Aktør",
          "identifier": "Associate",
          "databaseType": "COMPANY"
        }
      ]
    }
  }
}

For a table it is possible to fetch the following information:

  • the list of columns
  • the list of processings and reports
  • the list of relations from and to the table

The following example shows how to do this:

Query
query get_table_info
{
  useModel(lang: NORWEGIAN)
  {
    tables(tableNo : 65)
    {
      tableNo
      name
      identifier
      databaseType
      view
      primaryKeyClustered
      orgUnitClass
      folderNo
      formView
      primaryKeyAssignment
      columns
      {
        columnNo
        name
        identifier
        domain
        {
          domainNo
          domainTypeNo
          domainMembers
          {
            name
            identifier
            groupName
            valueNo
          }
        }
      }
      
      fromRelationsNo
      fromRelations
      {
        relationNo
        name
        identifier
        fromTableNo
        toTableNo
        fromColumnsNo
        toColumnsNo
      }
      
      toRelationsNo
      toRelations
      {
        relationNo
        name
        identifier
        fromTableNo
        toTableNo
        fromColumnsNo
        toColumnsNo
      }

      processingsNo
      processings
      {
        processingNo
        name
        identifier
        description
        rowIndependent
      }
      reportsNo
      reports
      {
         reportNo
         name
         identifier
         description
      }

      visible
      cloudVisible
      insertable
      cloudInsertable
      updatable
      cloudUpdatable
      deletable
      cloudDeletable
      readAccess
      cloudReadAccess
      insertAccess
      cloudInsertAccess
      updateAccess
      cloudUpdateAccess
      deleteAccess
      cloudDeleteAccess
      availability
    }
  }
}

Similarly, you can query, for instance, for:

  • all the columns in the system
  • all the columns of a specified table
  • a single column specifed by its column number

In the next example, we query information about all the columns from the Associate table:

Query
query get_columns_info
{
  useModel(lang: NORWEGIAN)
  {
    columns(tableNo : 152)
    {
      columnNo
      tableNo
      name
      identifier
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "columns": [
        {
          "columnNo": 4028,
          "name": "Aktørnr",
          "identifier": "AssociateNo"
        },
        {
          "columnNo": 4029,
          "name": "Navn",
          "identifier": "Name"
        },
        # ...
      ]
    }
  }}

On the other hand, in the next example, we query information about the associate number column (from the Associate table):

Query
query get_column_info
{
  useModel(lang: NORWEGIAN)
  {
    columns(columnNo: 4028)
    {
      columnNo
      tableNo
      name
      identifier
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "columns": [
        {
          "columnNo": 4028,
          "tableNo": 152,
          "name": "Aktørnr",
          "identifier": "AssociateNo"
        }
      ]
    }
  }
}

You can additionaly query for domain information for a column, as shown in the following example:

Query
query read_column_info
{
  useModel(lang: NORWEGIAN)
  {
    columns(columnNo : 3363)
    {
      columnNo
      tableNo
      name
      domain
      {
        domainNo
        name
        length
        columnWidth
        storeFixedDecimals
        displayFixedDecimals
        fixedDecimals
        dataType
        fieldJustification
        fileName
        domainMembers
        {
          name
          identifier
          valueNo
          includeValue
          initiallyOn
        }
      }
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "columns": [
        {
          "columnNo": 3363,
          "tableNo": 52,
          "name": "Ordrenr",
          "domain": {
            "domainNo": 555,
            "name": "Ordrenr",
            "length": 0,
            "columnWidth": 8,
            "storeFixedDecimals": false,
            "displayFixedDecimals": false,
            "fixedDecimals": 0,
            "dataType": "INT_32",
            "fieldJustification": "RIGHT",
            "fileName": false,
            "domainMembers": []
          }
        }
      ]
    }
  }
}

You can also query domains directly, by specifying the domain number:

Query
query read_domain_info
{
  useModel(lang: NORWEGIAN)
  {
    domains(domainNo : 555)
    {
      domainNo
      name
      length
      columnWidth
      storeFixedDecimals
      displayFixedDecimals
      fixedDecimals
      dataType
      fieldJustification
      fileName
      domainMembers
      {
        name
        identifier
        groupName
        valueNo
        includeValue
        groupIncludeValue
        initiallyOn
      }
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "domains": [
        {
          "domainNo": 555,
          "name": "Ordrenr",
          "length": 0,
          "columnWidth": 8,
          "storeFixedDecimals": false,
          "displayFixedDecimals": false,
          "fixedDecimals": 0,
          "dataType": "INT_32",
          "fieldJustification": "RIGHT",
          "fileName": false,
          "domainMembers": []
        }
      ]
    }
  }
}

Some domains are enumeration types. They define a set of possible values that can be stored in a column. The domainMembers field in the domain information query returns a list of domain members. An example is shown below:

Query
query read_domain_info
{
  useModel(lang: NORWEGIAN)
  {
    domains(domainNo : 111)
    {
      domainNo
      name
      length
      columnWidth
      storeFixedDecimals
      displayFixedDecimals
      fixedDecimals
      dataType
      fieldJustification
      fileName
      domainMembers
      {
        name
        identifier
        groupName
        valueNo
        includeValue
        groupIncludeValue
        initiallyOn
      }
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "domains": [
        {
          "domainNo": 111,
          "name": "Dok.­type",
          "length": 0,
          "columnWidth": 8,
          "storeFixedDecimals": false,
          "displayFixedDecimals": false,
          "fixedDecimals": 0,
          "dataType": "INT_32",
          "fieldJustification": "RIGHT",
          "fileName": false,
          "domainMembers": [
            {
              "name": "Purrebrev",
              "identifier": "Reminder",
              "groupName": "",
              "valueNo": 1,
              "includeValue": -1,
              "groupIncludeValue": -1,
              "initiallyOn": false
            },
            {
              "name": "Rentenota",
              "identifier": "InterestNote",
              "groupName": "",
              "valueNo": 2,
              "includeValue": -1,
              "groupIncludeValue": -1,
              "initiallyOn": false
            }
          ]
        }
      ]
    }
  }
}

Selecting the model

It is possible to query the core mode, the customer specific extensions to the model, or both together. This is done using the model argument for the useModel field, which can take the following values:

ValueDescription
COREOnly the core model is queried. This is the default value.
EXTENSIONSOnly the extension model is queried.
ALLBoth the core and the extension model are queried.

If you specify a core model but a model number such as table number or column number from the extensions or vice versa, no results will be returned, since the specified model does not contain the specified entity.

When the model is explicitly specified, a customer number is also required, since extensions are customer specific. If a customer number is not specified, an error will be returned.

The following example shows how to query all the tables from the extensions:

Query
query read_tables($cno : Int!)
{
    useModel(customer : $cno, model : EXTENSIONS)
    {
        tables
        {
            tableNo
            name
            identifier
            databaseType
        }
    }
}

Query arguments

There are several arguments that allow you to customize the query:

ArgumentDescription
langSpecifies the language for the translated text fields. Possible values are ENGLISH, NORWEGIAN, SWEDISH, and DANISH.
langNoSpecifies the language for the translated text fields using a numeric value. Possible values are 44 (English), 45 (Danish), 46 (Swedish), and 47 (Norwegian). If both lang and langNo are specified, lang is used and langNo is ignored.
transformIndicates how the text of the name field should be transformed.
transformArgsDefines the transformation arguments when the CUSTOM value is specified for the transform argument. More information about text transformation can be found in the next section.

These areguments are found on the useModel field. A deprecated way to specify the arguments is on the individual fields such as tables, columns, etc. When present on both the useModel field and the individual fields, the arguments on the individual fields are ignored.

In addition to these arguments, each field for retrieving model information (such as tables, columns, etc.) has its own specific arguments, typically for selecting a single entity, we was shown in the examples above (e.g. tableNo for tables, columnNo for columns, etc.).

Language selection

The language for the translations can be specified in two ways:

  • using the lang argument in the query, with one of the following values: ENGLISH, NORWEGIAN, SWEDISH, DANISH
  • using the langNo argument in the query, with one of the following values: 44 (English), 45 (Danish), 46 (Swedish), 47 (Norwegian)

If both arguments are specified, the lang argument is used (langNo is ignored).

The following two examples are equivalent:

Query
query get_tables_info
{
  useModel(lang: NORWEGIAN)
  {
    tables
    {
      tableNo
      name
      identifier
      databaseType
    }
  }
}
Result
query get_tables_info
{
  useModel(langNo: 47)
  {
    tables
    {
      tableNo
      name
      identifier
      databaseType
    }
  }
}

The langNo argument is useful for specifying the language based directly on settings, such as the user’s language preference (from the User table).

Text transformations

The translated text may contain several application-specific escape characters or sequences. These are:

  • ^ for a hyphen
  • | for a new line (\n)
  • & for an access key accelerator
  • {Ampersand} for an & character

When you retrieve the translated texts, these are automatically replaced with the appropriate character or sequence of characters. However, you can opt to perform your own custom replacement. This is possible with the following two arguments, available for all the fields under useModel:

ArgumentDescription
transformIndicates the transformation type: AUTO (the default option, application defined transformations), NONE (no transformation is performed), and CUSTOM (user-specified transformations are applied).
transformArgsDefines the transformation arguments when the CUSTOM value is specified for the transform argument.

The properties of the transformArgs parameter are as follows:

PropertyTypeDescription
modifyOptionalHyphenBooleanIndicates whether hyphen replacement will be performed.
optionalHyphenStringText for replacing the escape character (^) for a hyphen.
modifyManualLineBreakBooleanIndicates whether manual line break replacement will be performed.
manualLineBreakStringText replacing the escape character for manual line break.
modifyAccessKeyBooleanIndicates whether access key replacement will be performed.
accessKeyStringText for replacing the escape character (&) for an access key.
modifyAmpersandSubstituteBooleanIndicates whether ampersand substitute replacement will be performed.
ampersandSubstituteStringText for replacing the {Ampersand} escape sequence.

Here is an example for fetching raw texts:

Query
query get_table_info
{
  useModel(lang: NORWEGIAN, transform : NONE)
  {
    tables(tableNo : 138)
    {
      tableNo
      name
      identifier
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "tables": [
        {
          "tableNo": 138,
          "name": "Ordre^journal",
          "identifier": "OrderJournal"
        }
      ]
    }
  }
}

On the other hand, the following sample shows how to perform user-defined transformations:

Query
query get_table_info
{
  useModel(lang: NORWEGIAN,
           transform : CUSTOM,
           transformArgs : {
              modifyOptionalHyphen : true
              optionalHyphen : "-"
          })
  {
    tables(tableNo : 138)
    {
      tableNo
      name
      identifier
    }
  }
}
Result
{
  "data": {
    "useModel": {
      "tables": [
        {
          "tableNo": 138,
          "name": "Ordre-journal",
          "identifier": "OrderJournal"
        }
      ]
    }
  }
}

Access restrictions and availability

Most model entities provide properties that indicate the availability and access restrictions. These properties are:

PropertyTypeDescriptionApplies to
visibleBoolIndicates whether the entity is visible in the on-premise application.All
cloudVisibleBoolIndicates whether the entity is visible in the BNXT front-end application.All
writableBoolIndicates whether the entity is writable in the on-premise application.Columns, domain members
cloudWritableBoolIndicates whether the entity is writable in the BNXT front-end application.Columns, domain members
insertableBoolIndicates whether the entity is insertable in the on-premise application.Tables
cloudInsertableBoolIndicates whether the entity is insertable in the BNXT front-end application.Tables
updatableBoolIndicates whether the entity is updatable in the on-premise application.Tables
cloudUpdatableBoolIndicates whether the entity is updatable in the BNXT front-end application.Tables
deletableBoolIndicates whether the entity is deletable in the on-premise application.Tables
cloudDeletableBoolIndicates whether the entity is deletable in the BNXT front-end application.Tables
readAccessAccessIndicates the read access level for the entity in the on-premise application.All
cloudReadAccessCloudAccessIndicates the read access level for the entity in the BNXT front-end application.All
writeAccessAccessIndicates the write access level for the entity in the on-premise application.Columns, domain members
cloudWriteAccessCloudAccessIndicates the write access level for the entity in the BNXT front-end application.Columns, domain members
insertAccessAccessIndicates the insert access level for the entity in the on-premise application.Tables
cloudInsertAccessCloudAccessIndicates the insert access level for the entity in the BNXT front-end application.Tables
updateAccessAccessIndicates the update access level for the entity in the on-premise application.Tables
cloudUpdateAccessCloudAccessIndicates the update access level for the entity in the BNXT front-end application.Tables
deleteAccessAccessIndicates the delete access level for the entity in the on-premise application.Tables
cloudDeleteAccessCloudAccessIndicates the delete access level for the entity in the BNXT front-end application.Tables
deleteAccessAccessIndicates the delete access level for the entity in the on-premise application.Tables
cloudDeleteAccessCloudAccessIndicates the delete access level for the entity in the BNXT front-end application.Tables
executionAccessAccessIndicates the execution access level for the entity in the on-premise application.Processings, reports
cloudExecutionAccessCloudAccessIndicates the execution access level for the entity in the BNXT front-end application.Processings, reports
availabilityAvailabilityIndicates whether the entity is available for use (CURRENT), it will be available in the future (FUTURE), or it is available but it is deprecated and will be removed (OBSOLETE).All

The Default value for CloudAccess indicates that the access level is inherited from the on-premise application.

For a column to be available in GraphQL for reading, the following conditions must be met:

  • availability should be CURRENT
  • cloudReadAccess must be different than NONE and DEFAULT
  • if cloudReadAccess is DEFAULT then readAccess must be different than NONE

Similar rules are used for writing, inserting, updating, deleting, and executing access.

Model information properties

Tables

The following properties are available for tables :

PropertyTypeDescription
tableNoLongThe table number.
nameStringThe translated name of the table.
identifierStringA language-independent identifier of the table.
databaseTypeDatabaseTypeNoOne of COMPANY or SYSTEM.
viewboolIndicates whether the table is a view.
primaryKeys[Long]The primary keys’ column numbers in the order they’re defined in the database.
primaryKeyClusteredBoolIndicates whether the primary key is clustered.
orgUnitClassOrgUnitClassThe property returns one of the twelve values ORGUNITCLASS01 (1) – ORGUNITCLASS12 (12) if the table is associated with an organisational unit class, else NONE (0). The table will not be visible if the corresponding CompanyInformation.OrgUnit1NameOrgUnit12Name column is empty.
folderNoLongThe folder number the table belongs to, or 0 if none.
formViewBooltrue if new table page elements against this table should initially be displayed in Form view (instead of Grid view).
primaryKeyAssignmentPrimaryKeyAssignmentReturns one of the following values for how the last primary key column is assigned a value on rows in the table: NORMAL - the ordinary behaviour of the table, INCREMENTAL - the last primary key column will get the next unused value when a value suggestion is requested, or IDENTITY - The last primary key column is created as an IDENTITY column in the database (the last two only for top tables that does not have a sort sequence column).
columns[Query_UseModel_Tables_Columns]A collection of column objects for the columns in the table.
fromRelationsNo[Long]A collection of relation numbers from the table.
fromRelations[Query_UseModel_Tables_Relations]A collection of relation from the table.
toRelationsNo[Long]A collection of relation numbers for the relations to the table.
toRelations[Query_UseModel_Tables_Relations]A collection of relation to the table.
processingsNo[Long]A collection of processing numbers for the processings in the table.
processings[Query_UseModel_Tables_Processings]A collection of processing in the table.
reportsNo[Long]A collection of report numbers for the reports in the table.
reports[Query_UseModel_Tables_Reports]A collection of report in the table.

Relations

The following properties are available for relations:

PropertyTypeDescription
relationNoLongThe relation number.
nameStringThe translated name of the relation.
identifierStringA language-independent identifier of the relation.
fromTableNoLongThe table number that this relation refers from.
toTableNoLongThe table number that this relation refers to.
fromColumnsNo[Long]A collection of column numbers that define the from columns.
toColumnsNo[Long]A collection of column numbers that define the to columns.
switchOfColumnNoLongThe number of a column for this relation to apply to.
switchValueIntThe value that a column needs to have for this relation to apply. E.g. the debit (or credit) account type column on a voucher row that determines whether the debit (or credit) account number column refers to (1) a customer, (2) supplier, (3) general ledger account, or (4) capital asset.
noLookupBooltrue if the relation is not applicable for lookup, but e.g. only for (left outer) join purposes in i.a. layouts.
necessityNecessityReturns one of the following values for how necessary a corresponding reference is: REQUIRED, OPTIONAL, or PASS.
deleteRuleDeleteRuleReturns one of the following values to determine behavior when deleting or discarding a parent row: CASCADE will also delete or discard child rows, recursively downwards the hierarchy, or RESTRICT that demands that no references exist, e.g. to reject deletion of accounts with transactions.

Columns

The following properties are available for columns:

FieldTypeDescription
columnNoLongThe column number.
tableNoLongThe table number that this column belongs to.
nameStringThe translated name of the column.
identifierStringA language-independent identifier of the column.
orgUnitClassOrgUnitClassOne of the twelve values ORGUNITCLASS01ORGUNITCLASS12 if the column is associated with an organisational unit class, else NONE. The column will not be visible if the corresponding CompanyInformation.OrgUnit1NameOrgUnit12Name column is empty.
suggestValueInIntervalBooltrue if the column supports suggesting values in intervals.
breakValuesBooltrue if the column by default should show an aggregated value on group and total rows.
accumulateOnMergeBooltrue if the value in the column should be accumulated when rows are merged, e.g. on collection invoices.
recalculationRecalculationone of the following values for whether the value in the column should be recalculated according to the actual value on the current, parent row (order line), when page elements (e.g. stock balance or shipment) are joined via an underlying table (e.g. product): NO, UNIT, or PRICE.
formattingFormattingone of the following values for whether the column should apply formatting defined on the row: NO, ROWFRONT, or UNDERLINE.
viewZeroViewZeroone of the following values for whether 0 should be shown if the column is empty: NO, ZEROIFEMPTY, or ZEROIFNOTSUMLINE.
debitCreditTypeDebitCreditTypeone of the following values for how the memory column should be calculated: NONE, DEBIT, CREDIT.
currencyHandlingCurrencyHandlingone of the following values for whether the column is involved in currency calculations: NORMAL, LOGISTICSDOMESTICVALUE, ACCOUNTINGCURRENCYVALUE, ACCOUNTINGDOMESTICVALUE, EUROVALUE, or CURRENCY2VALUE.
lookupProcessingNoLongThe number of the processing that declares the lookup dialog for this column, if any.
domainQuery_UseModel_Columns_DomainsInformation about the domain for the column.

Domains and domain members

The following properties are available for domains:

FieldTypeDescription
domainNoLongThe domain number.
nameStringThe translated name of the domain.
identifierStringA language-independent identifier of the domain.
domainTypeNoIntThe domain type as a numeric value.
domainTypeNoAsEnumDomainTypeNoThe domain type as an enumeration value. Can be one of: VALUE (1), TEXTTYPE (2), MODELNO (3), FLAGS (4), INTEGER (5), DECIMAL (6), LIMITEDSTRING (7), UNLIMITEDSTRING (8), BLOB (9), or DATETIME (10).
dataTypeDataTypeThe kind of data that is stored in the column. Can be one of: INT_8, INT_16, INT_32, INT_64, DECIMAL, LIMITED_STRING, UNLIMITED_STRING, BLOB.
lenghtIntThe maximum number of characters that can be stored, or 0 if the domain type is not LIMITED_STRING.
columnWidthDecimalThe default column width, measured in the average number of characters that will fit in the column.
storeFixedDecimalsBooltrue if the domain type is DECIMAL and a fixed number of decimals should be stored.
displayFixedDecimalsBooltrue if the domain type is DECIMAL and a fixed number of decimals should be displayed by default.
fixedDecimalsIntThe actual number of fixed decimals (up to 6) that may be applied by default if the domain type is DECIMAL, else 0.
fieldJustificationFieldJustificationReturns one of the following values for how the values (and the column heading in grid view) should be aligned by default: CENTER, LEFT, or RIGHT.
fileNameBooltrue if the domain type is LimitedString and file name lookup is applicable.
domainMembers[Query_UseModel_Domains_DomainMembers]A list of domain member objects.

The following properties are available for domain members:

FieldTypeDescription
valueNoLongUnique domain member indentification number.
identifierStringA language-independent identifier of the domain member.
nameStringThe name of the domain member.
includeValueIntAn integer value to include in the name, or -1 if not applicable.
groupNameStringThe name of the group the domain member belongs to.
groupIncludeValueIntAn integer value to include in the group name, or -1 if not applicable.
initiallyOnBooltrue if this flag domain member is intended to be initially ON.

Processings

The following properties are available for processings:

FieldTypeDescription
processingNoLongThe processing number.
nameStringThe translated name of the processing.
identifierStringA language-independent identifier of the processing.
descriptionStringA textual description of the processing.
dialogOnlyBooltrue if the processing is intended to only show a dialog, typically visualizing one or more columns. Such processings have no parameters, and no processing contributions in the backend, so operations for getting data for a processing dialog, or executing a processing, should not be performed on them.
rowIndependentBooltrue if the processing is row-independent.

Reports

The following properties are available for reports:

FieldTypeDescription
processingNoLongThe report number.
nameStringThe translated name of the report.
identifierStringA language-independent report of the processing.
descriptionStringA textual description of the report.

Folders

The following properties are available for folders:

FieldTypeDescription
folderNoLongThe folder number.
nameStringThe translated name of the folder.
identifierStringA language-independent identifier of the folder.
isRootLooltrue if the folder is a root folder.
parentFolderNoLongThe number of the parent folder, or 0 if the folder is a root folder.
childFoldersNo[Long]A collection of folder numbers for the child folders.
Last modified March 2, 2026