Windows
Less than to read
This section describes the creation of a GraphQL mutation based on an X3 Window.
GraphQL mutations based on an X3 Window benefit from the standard business rules linked to X3 objects.
1. Window definition (GESAWI)
- Set up your Window as usual in X3.
- Predefined buttons are used on the API authorization setup:
- If Create is active, the operation may authorize Create mutations.
- If Delete is active, the operation creates may authorize Delete mutations.
- If Save is active, the operation creates may authorize Update mutations.
The Screen dictionary and Reference tables are used in the API operation (GESAPIOPE) function to automatically initialize the mapping between screen fields and node properties.
Note: If needed, the main node and references are also checked to initialize the mapping between the screen and node properties.
2. Create your operation (GESAPIOE)
Once the X3 Window is defined, you can map it to your node in the API operation function (GESAPIOPE).
Header
- Fill in the X3 operation identifier. The operation identifier must be unique.
- For X3 Windows, set the Mutation type field to Create/Update/Delete.
- Create, Update, and Delete are standard GraphQL operations. A single node may only have one of each.
- Use the checkboxes Can create, Can update, and Can delete in the Authorization section to select the mutation type (Create, Update, or Delete) for the operation.
- The mutation type Custom is not allowed for operations based on X3 Windows.
- Define the Operation method as Window to enable the X3 Window selection in the Definition section.
- Select the Main node name. This is the node where the operation will be generated.
- The node will show the operation when you explore the graph through an external tool.
- Multiple Custom operations can be linked to the same node, but only one Create, Update or Delete operations can be defined for a node.
- When nodes are generated, X3 will only consider the active Create, Update, or Delete operations defined in the API operation function (GESAPIOPE).
- Define the GraphQL operation name to be generated on the selected node.
- As a property name, the operation name must be unique in the node definition.
- The operation name must respect the naming convention (camelCase).
- For Create, Update, or Delete operations, the operation name is not used by the framework.
- Only the mutation type (Create, Update, or Delete) is used by the framework to determine the operation when a standard GraphQL Create, Update, or Delete mutation is triggered for a node.
- Consequently, the operation name can be anything, as it is not used by the framework.
Details
- Select the module.
- Select an activity code if needed.
- Mark the operation as active or not.
- Enter a Node binding (request) identifier.
- This identifier is a reference for the node bindings records generated for the operation.
- It is initialized by default by the X3 operation identifier.
- Enter a Node name (request).
- An operation that uses X3 Window is bound to the main node tied to the X3 screens.
- The Node name (request) field is initialized by default by the Main node.
- After saving the operation, a node definition is automatically generated in the node bindings table based on the Node binding (request) and Node name (request).
- This technical node is used to map the screen fields to the main node and build the mutation payload.
- The node definition is accessible in the Node binding dictionary (GESAPINOD).
- Enter the Package name where the operation will be generated.
- For partners, package selection is restricted to custom packages.
- For an operation based on an X3 Window, the Node binding (response) field is not available.
- For an operation based on an X3 Window, the following fields are enabled:
- Select the window to be used in the Window field.
- Depending on how the X3 screen is developed, you can select and map Invisible fields to node properties.
Authorizations
- Functional authorization: Ties the operation to a functional access defined in the Functional profile for the user's functional profile. This authorization is optional.
- Option: Ties the operation to an action code you can add to the access right definition for finer control. This authorization is optional.
- Checkboxes Can create, Can update, and Can Delete define the mutation type to be enabled in the operation.
- The checkboxes are controlled against the X3 Window definition and authorization.
- Only one Create, Update, or Delete operations can be defined for a node.
Window fields
- Bindings:
- Once you select an X3 Window code, the fields available to be mapped on the node are automatically loaded in the grid under the Binding column.
- If the Screens and Reference tables are properly configured, the Property names will be automatically loaded.
- The transient properties used to map the technical field defined on the screen must be selected manually.
- After saving the operation, the associated node binding record and properties are automatically created in the node bindings tables.
- The node operation is visible in the Node bindings function (GESANODEB) in the Windows left list.
- The node operation and properties are visible in the Bindings dictionary function (GESAPINOD).
- Use the Selection checkbox to validate the properties to be mapped on the Screen fields.
- Note: The new fields added afterward to the Screen definition will be displayed on the associated API operation unticked. After, it will be possible to set the corresponding property names from the node and mark the new screen fields as selected for the mapping.
- Even if a mandatory property is missing from the mapping, the operation can be saved but it will not be possible to activate.
How to manage collections
- Add the collection friendly name to the property column at the parent level.
- Use the NBLIG field to map the collection friendly name in the property column.
- Note: The field code will not always be NBLIG in the screen definition. The most important is the ABS field type.
- The parent level must always be on the line just above the line collection.
- On collection properties, fill in the parent property matching with the collection friendly name of the parent.
- If multiple collections exist for the same parent node, you must define the parent line for each collection.
- As an example, please see the API Operation mapping for the standard operation SAL_SOH_CUD based on the OSOH window.
How to manage denormalized collections (dimensioned fields)
- Add the property name and the denormalized collection name in the corresponding columns.
- Properties with dimensions are grouped in a single line in the operation.
- The dimension column indicates the number of dimensions defined and managed in the import template.
- The list of fields in the grid is sorted the same as the list of fields in the X3 Window. This includes the dimension fields.
- Please refer to the API Operation SAL_SOH_CUD for examples.
Case of denormalized collections in grids
- When a dimension field is defined in a List on the screen, the mapping must explicitly be the property + index to be mapped on the screen field.
- For example, taxes~1, taxes~2, etc.
How to manage X3 Entry transactions
- For the functions managed with Entry transactions, defining the transaction on the API operation is optional.
- By default, all the fields defined on the window’s screen are used.
Add a transient property called _x3Transaction to the node in the Node bindings function.
After having regenerated the nodes, if the _x3Transaction property is defined on a node, the value can be sent to the GraphQL mutation in the following manner:
mutation {
x3Sales {
salesOrder {
create(
data: {
_x3Transaction: "ALL"
soldToCustomer: "FR001",
salesSite: "FR011",
shippingSite: "FR011",
customerOrderReference: "406-8906115-0661156"
salesOrderLines: [
{
product: "DIS001",
quantityInSalesUnitOrdered: 100
}
]
}
) {
id
}
}
}
}
For an update mutation:
mutation {
x3Sales {
salesOrder {
update
(
data: {
_x3Transaction: "ALL"
id: "SONFR0110104",
customerOrderReference: "406-8906115-0661156", }
) {
_id
}
}
}
}
For the delete mutation, it is not possible to send the value to the GraphQL mutation. The delete mutation only accepts the primary key of the record to be deleted in the following manner:
mutation {
x3Sales {
salesOrder {
delete(id: "SONFR0110104")
}
}
}
- If X3 does not receive any value for the transaction through the GraphQL mutation, the DEFTRANS action is called in the window’s script.
- DEFTRANS allows developers to optionally code the methods to search for a default transaction for the API if the function does not manage a default transaction natively.
- Note: The GAXTREEM variable must be tested to ensure that this action is only executed if the window's script is executed from an API.
- Optionally, if necessary, you can use the CLECUR1 variable to know the key to the current record being processed.
- To avoid conflicts in Object management, it is recommended to read the record in a dedicated function as it uses a dedicated local file.
Note: The X3 default transactions must have been validated in X3.
How to manage BLOC fields and TXC data types
- For the tables managing CLOB fields through the TXC datatype, TXC fields are only storing the reference keys to the table containing the CLOB field.
- To manage such properties in a GraphQL mutation, a mapping between the CLOB property defined on the node and a field on the X3 screen must be defined on the API operation.
- First, add a new hidden CLOB field on the screen.
- In the API operation function, the new CLOB field must be mapped to the corresponding property on the node. After, the CLOB value can be received in the X3 function.
- Then, the CLOB value must be managed in the X3 function.
- Example: The GESSOH function is storing the CLOB field using this standard code:
- The ACLOB action is used to save the CLOB value in memory before saving it in the database.
- Executed from a GraphQL mutation, the ACLOB action can’t be used.
- The following code must be added to the GESSOH function to simulate the ACLOB action.
- Do not forget to test the GAXTREEM global variable to execute this code only in an API context.
- Note: X3 does not support some special characters, such as smileys or icons, in plain text clogs.
How to manage hidden fields
- For screens with some hidden fields to be mapped on a node, the associated displayed fields on the screen can be linked using the Non-hidden field column in the API operation function (GESAPIOPE).
- Hidden fields are used for example in the Customer management function (OBPC) or the Supplier management function (OBPS) to enter addresses or contacts. They are also used in the Product management function (OITM) to enter customers or suppliers.
- For example, in the OBPS Window, the Supplier node properties used to manage the address collection are mapped on hidden fields such as [M:BPAS]BPADES, [M:BPAS]CRYNAM, etc.
- While the fields displayed on the screen to enter addresses are the X fields, such as [M:BPAS]XBPADES, [M:BPAS]XCRYNAM, etc., the link between the Node property fields and the X fields displayed on the screen must be declared in the API operation in the Non-hidden field column.
- For each of the hidden fields related to the address collection in the OBPS window, the Non-hidden field column must be used to link the corresponding fields displayed and entered on the screen.
- Important: To properly link hidden fields to a node, the Grid bloc number must be defined in the Blocks section for List block types to be linked to the corresponding Table block type in the screen definition.
Operation override
- Any standard operation type or method can be customized by creating specific ones and using the Operation override field.
- Please see the documentation regarding Operation override.
Generated nodes
- If a Create, Update, or Delete operation is defined on a node in X3, the following attributes will be added to the X3 services node definition after running the npm run generate command in VSCode:
canCreate: true
canUpdate: true
canDelete: true
Example of mutations based on the Sales order function (GESSOH)
Create mutation
mutation {
x3Sales {
salesOrder {
create(
data: {
_x3Transaction: "ALL"
soldToCustomer: "FR001",
salesSite: "FR011",
shippingSite: "FR012",
customerOrderReference: "12-123456789-99"
soldToCustomerCompanyNames: [
{
denormalizedIndex: 1
companyName: "Company Name Line 1"
}
{
denormalizedIndex: 2
companyName: "Company Name Line 2"
}
]
soldToCustomerCountry: "FR"
soldToCustomerAddressLines: [
{
denormalizedIndex: 1
addressLine: "Address Line 1"
}
{
denormalizedIndex: 2
addressLine: "Address Line 2"
}
{
denormalizedIndex: 3
addressLine: "Address Line 3"
}
]
soldToCustomerPostalCode: "75000"
soldToCustomerCity: "PARIS"
shipToCustomerCompanyNames: [
{
denormalizedIndex: 1
companyName: "Company Name Line A"
}
{
denormalizedIndex: 2
companyName: "Company Name Line B"
}
]
shipToCustomerCountry: "FR"
shipToCustomerAddressLines: [
{
denormalizedIndex: 1
addressLine: "Address Line A"
}
{
denormalizedIndex: 2
addressLine: "Address Line B"
}
{
denormalizedIndex: 3
addressLine: "Address Line C"
}
]
shipToCustomerPostalCode: "73000"
shipToCustomerCity: "CHAMBERY"
billToCustomerCompanyNames: [
{
denormalizedIndex: 1
companyName: "Company Name Line X"
}
{
denormalizedIndex: 2
companyName: "Company Name Line Y"
}
]
billToCustomerCountry: "FR"
billToCustomerAddressLines: [
{
denormalizedIndex: 1
addressLine: "Address Line X"
}
{
denormalizedIndex: 2
addressLine: "Address Line Y"
}
{
denormalizedIndex: 3
addressLine: "Address Line Z"
}
]
billToCustomerPostalCode: "69000"
billToCustomerCity: "LYON"
dimensions: [
{
denormalizedIndex: 1
dimension: "COMM-001"
}
{
denormalizedIndex: 2
dimension: "GOVERMENT"
}
{
denormalizedIndex: 3
dimension: "911"
}
{
denormalizedIndex: 4
dimension: "FR0112101000066"
}
{
denormalizedIndex: 5
dimension: "RENTAL"
}
]
salesOrderLines: [
{
product: "BMS005",
quantityInSalesUnitOrdered: 100
taxes: [
{
denormalizedIndex: 1
taxLevel: "EXO"
}
]
salesRep1: "FR252"
salesRep1CommissionRate: 12.34
orderLineText: {
value: "{\\rtf1\\ansi{\\fonttbl{\\f0 MS Sans Serif;}{\\f1 Consolas, Courier New, monospace;}}{\\colortbl;\\red175\\green0\\blue219;\\red0\\green0\\blue255;\\red0\\green16\\blue128;\\red163\\green21\\blue21;\\red0\\green112\\blue193;\\red38\\green127\\blue153;}\\uc0\\pard\\fs24\\pard\\ql\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3FinanceData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-finance-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3MasterData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-master-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3ProjectManagementData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-project-management-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3System\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-system'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 decorators\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Node\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Reference\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 integer\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 date\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 decimal\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 TextStream\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Collection\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Context\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-core'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 DateValue\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-date-time'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 X3StorageManager\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Joins\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-x3-gateway'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageXtremX3SystemUtils\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-x3-system-utils'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3ProjectManagement\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '..'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\par\\pard\\ql{\\fs22\\cf2\\highlight0\\f1 const\\f0\\highlight0\\cf0}{\\fs22\\cf5\\highlight0\\f1 joins\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 : \\f0\\highlight0\\cf0}{\\fs22\\cf6\\highlight0\\f1 Joins\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 \\'3c\\f0\\highlight0\\cf0}{\\fs22\\cf6\\highlight0\\f1 TimeEntryLine\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 \\'3e = \\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 referenceJoins\\f0\\highlight0\\cf0}\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 employee\\f0\\highlight0\\cf0}\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 employee\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 'employee'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ,\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\fs22\\cf0\\highlight0\\f1 ,\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\par}"
}
}
{
product: "BMS001",
quantityInSalesUnitOrdered: 200
}
{
product: "BMS002",
quantityInSalesUnitOrdered: 300
}
{
product: "BMS003",
quantityInSalesUnitOrdered: 400
}
{
product: "BMS004",
quantityInSalesUnitOrdered: 500
}
]
orderFooterText: {
value: "{\\rtf1\\ansi{\\fonttbl{\\f0 MS Sans Serif;}{\\f1 Consolas, Courier New, monospace;}}{\\colortbl;\\red175\\green0\\blue219;\\red0\\green0\\blue255;\\red0\\green16\\blue128;\\red163\\green21\\blue21;\\red0\\green112\\blue193;\\red38\\green127\\blue153;}\\uc0\\pard\\fs24\\pard\\ql\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3FinanceData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-finance-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3MasterData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-master-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3ProjectManagementData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-project-management-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3System\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-system'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 decorators\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Node\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Reference\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 integer\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 date\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 decimal\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 TextStream\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Collection\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Context\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-core'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 DateValue\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-date-time'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 X3StorageManager\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Joins\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-x3-gateway'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageXtremX3SystemUtils\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-x3-system-utils'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3ProjectManagement\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '..'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\par\\pard\\ql{\\fs22\\cf2\\highlight0\\f1 const\\f0\\highlight0\\cf0}{\\fs22\\cf5\\highlight0\\f1 joins\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 : \\f0\\highlight0\\cf0}{\\fs22\\cf6\\highlight0\\f1 Joins\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 \\'3c\\f0\\highlight0\\cf0}{\\fs22\\cf6\\highlight0\\f1 TimeEntryLine\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 \\'3e = \\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 referenceJoins\\f0\\highlight0\\cf0}\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 employee\\f0\\highlight0\\cf0}\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 employee\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 'employee'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ,\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\fs22\\cf0\\highlight0\\f1 ,\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\par}"
}
orderHeaderText: {
value: "{\\rtf1\\ansi{\\fonttbl{\\f0 MS Sans Serif;}{\\f1 Consolas, Courier New, monospace;}}{\\colortbl;\\red175\\green0\\blue219;\\red0\\green0\\blue255;\\red0\\green16\\blue128;\\red163\\green21\\blue21;\\red0\\green112\\blue193;\\red38\\green127\\blue153;}\\uc0\\pard\\fs24\\pard\\ql\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3FinanceData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-finance-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3MasterData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-master-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3ProjectManagementData\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-project-management-data'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3System\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/x3-system'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 decorators\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Node\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Reference\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 integer\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 date\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 decimal\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 TextStream\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Collection\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Context\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-core'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 DateValue\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-date-time'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 X3StorageManager\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 , \\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 Joins\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-x3-gateway'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageXtremX3SystemUtils\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '@sage/xtrem-x3-system-utils'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf1\\highlight0\\f1 import\\f0\\highlight0\\cf0}{\\fs22\\cf2\\highlight0\\f1 *\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 as\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 sageX3ProjectManagement\\f0\\highlight0\\cf0}{\\fs22\\cf1\\highlight0\\f1 from\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 '..'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ;\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\par\\pard\\ql{\\fs22\\cf2\\highlight0\\f1 const\\f0\\highlight0\\cf0}{\\fs22\\cf5\\highlight0\\f1 joins\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 : \\f0\\highlight0\\cf0}{\\fs22\\cf6\\highlight0\\f1 Joins\\f0\\highlight0\\cf0}{\\fs22\\cf0\\highlight0\\f1 \\'3c\\f0\\highlight0\\cf0}{\\fs22\\cf6\\highlight0\\f1 TimeEntryLine\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 \\'3e = \\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 referenceJoins\\f0\\highlight0\\cf0}\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 employee\\f0\\highlight0\\cf0}\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql{\\fs22\\cf3\\highlight0\\f1 employee\\f0\\highlight0\\cf0}{\\fs22\\cf3\\highlight0\\f1 :\\f0\\highlight0\\cf0}{\\fs22\\cf4\\highlight0\\f1 'employee'\\f0\\highlight0\\cf0}\\fs22\\cf0\\highlight0\\f1 ,\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\fs22\\cf0\\highlight0\\f1 ,\\f0\\highlight0\\cf0\\fs24\\par\\pard\\ql\\par}"
}
}
) {
id
}
}
}
}
Delete mutation
mutation {
x3Sales {
salesOrder {
delete(id: "SONFR011000000000154")
}
}
}
Update mutation
mutation {
x3Sales {
salesOrder {
update
(
data: {
_x3Transaction: "ALL"
id: "SONFR0110100",
customerOrderReference: "99-987654321-21"
project: ""
soldToCustomerCompanyNames: [
{
denormalizedIndex: 1
companyName: "Company Name Line UPD1"
}
{
denormalizedIndex: 2
companyName: "Company Name Line UPD2"
}
]
soldToCustomerCountry: "FR"
soldToCustomerAddressLines: [
{
denormalizedIndex: 1
addressLine: "Address Line UPD1"
}
{
denormalizedIndex: 2
addressLine: "Address Line UPD2"
}
{
denormalizedIndex: 3
addressLine: "Address Line UPD3"
}
]
soldToCustomerPostalCode: "74000"
soldToCustomerCity: "ANNECY"
shipToCustomerCompanyNames: [
{
denormalizedIndex: 1
companyName: "Company Name Line UPDA"
}
{
denormalizedIndex: 2
companyName: "Company Name Line UPDB"
}
]
shipToCustomerCountry: "FR"
shipToCustomerAddressLines: [
{
denormalizedIndex: 1
addressLine: "Address Line UPDA"
}
{
denormalizedIndex: 2
addressLine: "Address Line UPDB"
}
{
denormalizedIndex: 3
addressLine: "Address Line UPDC"
}
]
shipToCustomerPostalCode: "73000"
shipToCustomerCity: "CHAMBERY"
billToCustomerCompanyNames: [
{
denormalizedIndex: 1
companyName: "Company Name Line UPDX"
}
{
denormalizedIndex: 2
companyName: "Company Name Line UPDY"
}
]
billToCustomerCountry: "FR"
billToCustomerAddressLines: [
{
denormalizedIndex: 1
addressLine: "Address Line UPDX"
}
{
denormalizedIndex: 2
addressLine: "Address Line UPDY"
}
{
denormalizedIndex: 3
addressLine: "Address Line UPDZ"
}
]
billToCustomerPostalCode: "69000"
billToCustomerCity: "LYON"
dimensions: [
{
denormalizedIndex: 1
dimension: "COMM-002"
}
{
denormalizedIndex: 2
dimension: "GOVERMENT"
}
{
denormalizedIndex: 3
dimension: "911"
}
{
denormalizedIndex: 4
dimension: ""
}
{
denormalizedIndex: 5
dimension: "RENTAL"
}
]
orderHeaderText: {
value: ""
}
salesOrderLines: [
{
_action: "update"
lineNumber: 1000,
sequenceNumber: 1000,
salesRep1: ""
quantityInSalesUnitOrdered: 5015,
orderLineText: {
value: ""
}
}
{
_action: "delete"
lineNumber: 2000,
sequenceNumber: 2000,
}
{
_action: "create"
product: "BMS005",
quantityInSalesUnitOrdered: 601
}
]
}
) {
_id
}
}
}
}
Create mutation including a plain text CLOB
mutation {
x3Sales {
salesOrder {
create(
data: {
_x3Transaction: "ALL"
soldToCustomer: "FR001",
salesSite: "FR011",
shippingSite: "FR012",
customerOrderReference: "99-999999"
salesOrderLines: [
{
product: "BMS001",
quantityInSalesUnitOrdered: 101
}
]
orderHeaderText: {
value: """ Pour envoyer le contenu d'un fichier texte dans une requête GraphQL à partir d'un éditeur, vous pouvez suivre ces étapes générales :
1. **Ouvrir le fichier texte** : Utilisez votre éditeur de texte préféré (comme VS Code, Sublime Text, ou même un éditeur en ligne) pour ouvrir le fichier texte contenant les données que vous souhaitez envoyer.
2. **Copier le contenu** : Sélectionnez et copiez le contenu du fichier texte.
3. **Préparer la requête GraphQL** : Dans votre éditeur, préparez la requête GraphQL. Voici un exemple de requête GraphQL où vous pouvez insérer le contenu copié :
4. **Coller le contenu** : Remplacez `VOTRE_CONTENU_ICI` par le contenu copié de votre fichier texte. Assurez-vous que le contenu est correctement formaté et échappé si nécessaire.
5. **Envoyer la requête** : Utilisez un outil comme Postman, Insomnia, ou GraphiQL pour envoyer la requête. Collez la requête préparée dans l'éditeur de requêtes de l'outil choisi et exécutez-la.
Si vous avez des questions spécifiques ou des détails supplémentaires sur votre cas d'utilisation, n'hésitez pas à les partager !
"""
}
}
) {
id
}
}
}
}