Operations

Use the Operations function (GESAPIOPE) to link existing or specific Sage X3 functions, such as sub-programs, windows, classes or import templates, to API nodes.

Active operations are exposed as GraphQL mutations. In GraphQL, mutations are used to modify the server data. The GraphQL mutation request is sent to the Sage X3 operation through the Syracuse server, and the server returns a success or failure response.

Prerequisites

Depending on your situation, you need to create:

  • Subprograms and parameters in the Subprograms function (GESASU)

  • Import templates from the Import/export templates function (GESAOE)

  • Windows from the Window management function (GESAWI)

  • Classes from the Classes function (GESACLA)

  • Node scripts in VS Code

Follow the procedures described under the Sage X3 Builder Mutations chapter on developer.sage.com.

Screen management

The screen is defined in 7 tabs:

  • The header,

  • The General tab,

  • The Variables tab,

  • The Imports tab,

  • The Window tab,

  • The Class tab,

  • The Node script tab.

This section outlines the key information for API operations.

General

This section defines the characteristics, the node bindings, and the authorizations related to your API operation.

Variables

This section allows you to map your subprogram to your node after creating it in the Users function (GESAUS).

For further information, refer to the Subprograms procedure on developer.sage.com.

Imports

This section allows you to create a GraphQL mutation based on an import template. This is the most versatile way of creating GraphQL mutations while benefiting from the standard business rules linked to objects in Sage X3 when necessary.

You must sort the list of fields in the grid as in the import template, including the dimension fields.

Don't sort the dimensioned fields by index in the Import/export templates function (GESAOE). You need to sort them by name. As an example, refer to the JSOBPC customer import template (TEL(0), TEL(1), WEB(0), WEB(1), and so on).

For further information, refer to the Import templates procedure on developer.sage.com.

Window

This section allows you to create a GraphQL mutation based on an existing Sage X3 window. You can then benefit from the standard business rules linked to Sage X3 objects.

For further information, refer to the Windows procedure on developer.sage.com.

Class

This section allows you to create a GraphQL mutation based on an existing Sage X3 class.

Node script

This section allows you to create a GraphQL mutation based on a node script for custom operation types.

You can use this operation type to declare operations executed at the Sage X3 Services side on a node.

The operation executes a function developed in TypeScript that is similar to computed values.

Specific buttons

Error messages

The only error messages are the generic ones.

Tables used

The following tables are implemented by the function:

Table Table description
APIOPE [APIOPE] API operation