### Example Sage X3 Connection Configuration Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_Sage-X3-Services-dev-studio-installation An example YAML configuration for the `xtrem-config.yml` file, demonstrating how to set up connection parameters for Sage X3, including database details, API URLs, and language settings. ```yaml development: api: url: "http://x3erpv12:8124/xtrem/mutation" secret: "your_secret_key" driver: "tedious" hostname: "your_sql_server_hostname" port: 1433 stringdatabase: "x3v12" user: "your_db_user" password: "your_db_password" folderName: "SEED" reference: "X3" defaultLanguage: "ENG" ``` -------------------------------- ### Install and Start Sage X3 Services using PowerShell Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_Sage-X3-Services-installation This PowerShell command installs and starts the Sage X3 Services Windows service from the new installation folder. Successful execution should return 'Install complete' and 'Start complete' messages. ```powershell PS D:\SageX3\x3-services> .\install.ps1 Install complete. Start complete. PS D:\SageX3\x3-services> ``` -------------------------------- ### Sage X3 ERP File Naming Convention - Examples Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_about-files-naming Illustrates the application of the Sage X3 ERP file naming convention with concrete examples for application server installers and runtime components. ```text x3-application-12.0.19.jar runtime-91.3.5.12.jar syracuse-server-12.0.19.jar ``` -------------------------------- ### Sage X3 ERP Print Server Startup Command Example Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_print-server-presentation-and-operation-guide This example demonstrates a typical command-line invocation for starting the Sage X3 ERP Print Server in console mode with specific options enabled. It includes parameters for disabling the service, enabling verbose logging, and disabling ODBC source control. ```bash AdxSrvImp.exe /noservice /d /verbose /noodbc ``` -------------------------------- ### Example GET Request and Response Payload Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/api-guide_api-get-query Illustrates a concrete example of calling the API to list endpoints and the expected JSON response. The response includes metadata like total results and an array of resources, each with its own properties and metadata. ```http http://my_server:8124/api1/syracuse/collaboration/syracuse/endPoints?representation=endPoints.%24query&count=100 ``` ```json { "$url": "http://my_server:8124/api1/syracuse/collaboration/syracuse/endPoints?representation=endPoints.%24query&count=100", "$descriptor": "endPoints", "$startIndex": 1, "$itemsPerPage": 100, "$totalResults": 3, "$ui": ..., "$resources": [ { "$uuid": "20a5550c-5412-476d-a4ad-2c85074176ea", "$key": "20a5550c-5412-476d-a4ad-2c85074176ea", "$url": "/api1/syracuse/collaboration/syracuse/endPoints('20a5550c-5412-476d-a4ad-2c85074176ea')?representation=endPoint.$details", "$etag": 1, "$creUser": "admin", "$creDate": "2013-12-07T13:44:21.304Z", "$updUser": "admin", "$updDate": "2013-12-07T13:44:21.304Z", "$properties": { "databaseDriver": { "$isMandatory": false, "$isHidden": true }, ... "menuProfileToRoles": { "$isHidden": false } }, "description": "SEED folder on demo Syracuse solution", "application": "x3", "contract": "erp", "protocol": "x3", "dataset": "SEED", "databaseDriver": "mongodb", "x3ServerFolder": "SEED", "x3SolutionName": "DEMOSYR", "applicationRef": { "$uuid": "46976d3e-127f-4e66-9cf0-c8fb985b4aa0", "$key": "46976d3e-127f-4e66-9cf0-c8fb985b4aa0", "description": "X3 ERP" }, "x3server": { ... }, "$value": "SEED folder on demo Syracuse solution" }, { ... } ], "$links": { "$excel": { "$url": ..., "$title": "Excel", "$type": "application/syracuse-excel-worksheet" } }, "$template": { ... } } ``` -------------------------------- ### Install Sage X3 Developer Studio on Windows Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_Sage-X3-Services-dev-studio-installation Command to clean and install the Sage X3 developer studio on a Windows operating system. This is typically run from within the Visual Studio Code terminal in the studio's root directory. ```shell npm run clean:install:win ``` -------------------------------- ### Install Sage X3 Developer Studio on Unix Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_Sage-X3-Services-dev-studio-installation Command to clean and install the Sage X3 developer studio on a Unix-like operating system (Linux, macOS). Execute this command in the Visual Studio Code terminal within the studio's root directory. ```shell npm run clean:install:unix ``` -------------------------------- ### Nanny Process Installation Command Line - Node.js Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_load-balancer Installs a nanny process, specifying the port and the number of child processes. This command performs a database operation and does not start the nanny process itself. An optional parameter can be added for the number of web service child processes. ```bash node nanny install 8000 2 node nanny install 8000 2 3 ``` -------------------------------- ### Example of HTTP GET Request using EXEC_HTTP Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/api-guide_api-asyrwebser This example demonstrates how to use the EXEC_HTTP function to perform an HTTP GET request. It sets up the necessary header information, including the URL and method, and then calls EXEC_HTTP. The code checks the returned status code to ensure the request was successful. ```Sage X3 ERP Script Funprog HTTP_GET(RESHEAD, RESBODY) Variable Clbfile RESHEAD() Variable Clbfile RESBODY() Local Char HEADERCOD(64)(3) Local Char HEADERVAL(255)(3) HEADERCOD(0) = "url" HEADERVAL(0) = "http://footballpool.dataaccess.eu/data/info.wso?wsdl" HEADERCOD(1) = "method" HEADERVAL(1) = "GET" Local Clbfile BODY(0) BODY = '{}' Local Integer STATUSCODE STATUSCODE = func ASYRWEBSER.EXEC_HTTP(HEADERCOD, HEADERVAL, BODY, RESHEAD, RESBODY) If STATUSCODE <> 200 Goto END_HTTP_GET Endif $END_HTTP_GET End STATUSCODE ``` -------------------------------- ### Install and Use Node.js Version with NVM Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_Sage-X3-Services-dev-studio-installation Installs and sets a specific Node.js version required by the Sage X3 developer studio using Node Version Manager (NVM). Ensure you use the version specified in the .nvmrc file. ```shell nvm install [version] nvm use [version] ``` -------------------------------- ### Sage X3 Choose Function Example Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_Choose Demonstrates the practical application of the 'Choose' function. It includes opening a table (BPCUSTOMER), then using 'Choose' with WHERE, ORDER BY, Using, Titled, and Starting At clauses to filter and display customer records. ```Sage X3 4GL # Let's open a table Local File BPCUSTOMER [SELB] # Let's open the selection popup Choose [SELB] & Where BPCNAM>"D" & Order By BPCNAM; PTE; BPCNUM Using & [SELB]BPCNUM Titled "Customer ID", & [SELB]BPCNAM Titled "Customer name", & Titled "Select a customer" & Starting At [SELB]BPCNAM >= "DE" and [ZMS]PTE <>"CHQ" ``` -------------------------------- ### Example Local Menu Path in Sage X3 Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/workbench-reference_reports-sandbox This example demonstrates the expected format for a local menu path in Sage X3 ERP, based on the PrintServer installation directory and other configuration details. It shows how the system constructs the path to access local menu files. ```text C:\Sage\SafeX3\PRTSRV\Data\SEED10_FRPO402328_20130\GEN\ALL\MENL ``` -------------------------------- ### Object Creation Example (OBJAYZ) Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/FCT/GESAY_ADV_AJAX Example demonstrating how to call the X3 object interface (OBJAYZ) to create an entry and display the response. ```APIDOC ## POST /xtend/ajax/SOLPAIE/PAIE/FDBTEST/INT/OBJAYZ/S ### Description This endpoint allows for the creation of entries via the X3 object interface OBJAYZ. ### Method POST ### Endpoint http://ecfdalbopro:28980/xtend/ajax/SOLPAIE/PAIE/FDBTEST/INT/OBJAYZ/S ### Parameters #### Request Body - **TTL** (string) - Required - Title of the form. - **MAICOD** (string) - Required - Email address. - **CMT** (string) - Required - Comment. ### Request Example ```javascript var wClassCaller = Class.create(XTENDWSVC.classCallerObject, { onSuccess: function(response) { response.xtdDisplay(); } }); var wJSONOpts = new XTENDWSVC.classJsonOpt().noGroups(); var wParams = new XTENDWSVC.classParamObject(null, wJSONOpts); wParams.add("TTL", "Titre du formulaire"); wParams.add("MAICOD", "frdal@sage.com"); wParams.add("CMT", "Commentaire"); new wClassCaller("OBJAYZ").actCreate(wParams); ``` ### Response #### Success Response (200) - **FRMCOD** (string) - Form code. - **FCYCOD** (string) - Factory code. - **ZFCYCOD** (string) - Factory name. - **TYP** (string) - Type. - **ZTYP** (string) - Type description. - **STATUT** (string) - Status. - **STATUT_LBL** (string) - Status label. - **TTL** (string) - Title. - **MAICOD** (string) - Email address. - **CREDAT** (string) - Creation date. - **CREHEURE** (string) - Creation time. - **CMT** (string) - Comment. - **PARCOD** (array) - Parameter codes. - **PARVAL** (array) - Parameter values. - **WW_MODSTAMP** (string) - Modification timestamp. - **WW_MODUSER** (string) - Modification user. #### Response Example ```json { "FRMCOD": "0902000005", "FCYCOD": "FDBTEST", "ZFCYCOD": "Site de test fdalbo", "TYP": "OTH", "ZTYP": "Divers", "STATUT": "1", "STATUT_LBL": "A traiter", "TTL": "Titre du formulaire", "MAICOD": "frdal@sage.com", "CREDAT": "20090227", "CREHEURE": "184431", "CMT": "Commentaire", "PARCOD": [], "PARVAL": [], "WW_MODSTAMP": "000000000000", "WW_MODUSER": "" } ``` ``` -------------------------------- ### Localization Section Example (JSON) Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/how-to_how-to-transfer-administration-data Illustrates the structure of the '$localization' section, which holds translations for localized descriptions and titles across different languages. Each language key maps to an object containing translations identified by unique IDs. ```json "$localization": { "de-de": { "description_a84c663c-e01a-4e5d-a18a-ed1281095a0f": "Benutzer", "description_7c20fcce-edd3-4017-a6a3-36e3d8650b9e": "Persönlichen Profil", "title_963b8544-7fe2-4b99-8b95-ff25b6e77df2": "Benutzer Transaktionen", ... }, "en-en": { "description_a84c663c-e01a-4e5d-a18a-ed1281095a0f": "User", "description_7c20fcce-edd3-4017-a6a3-36e3d8650b9e": "Personal profile", "title_963b8544-7fe2-4b99-8b95-ff25b6e77df2": "User Transactions", ... }, "fr-fr": { "description_a84c663c-e01a-4e5d-a18a-ed1281095a0f": "Utilisateur", "description_7c20fcce-edd3-4017-a6a3-36e3d8650b9e": "Profil personnel", "title_963b8544-7fe2-4b99-8b95-ff25b6e77df2": "Transactions utilisateur", ... }, ... } ``` -------------------------------- ### JSON Item Example for Role Entity in Sage X3 ERP Export Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/how-to_how-to-transfer-administration-data This JSON object provides an example of a 'role' entity from the 'item' section of an export file. It includes the entity type, code, description, associated badges, and the security profile assigned to the role. ```JSON { "$type": "role", "code": "ERP-APACCMAN", "description": "description_7e6964a5-7d2a-47f7-9d24-95c07e60dbad", "badges": [ "ERPFIN" ], "securityProfile": "User" } ``` -------------------------------- ### Example Entity Description JSON in Sage X3 ERP Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/how-to_how-to-transfer-administration-data This JSON output represents the structure of a 'user' entity obtained via the $prototype URL. It includes details about the entity's type, URLs, display properties, and a comprehensive list of its individual properties with their respective configurations. ```json { "$type": "application/json", "$prototype": "{$baseUrl}/$prototypes('{$representation}.$details')", "$url": "{$baseUrl}/{$pluralType}('{$key}')", "$shortUrl": "{$baseUrl}/{$pluralType}('{$key}')", "$value": "{login}", "$title": "{firstName} {lastName}", "$key": "{$uuid}", "$description": "{firstName}'s profile", "$pluralType": "users", "$representation": "user", "$properties": { "login": { "$title": "Login", "$displayLength": 8, "$isUnique": true, "$isMandatory": true, "$capabilities": "sort,filter,alphaTab", "$links": { "$details": { "$type": "application/json;vnd.sage=syracuse", "$url": "{$baseUrl}/{$pluralType}('{$key}')?representation={$representation}.$details&role={$role}" } }, "$type": "application/x-string" }, "title": { "$title": "Title", "$displayLength": 4, "$capabilities": "sort,filter,alphaTab", "$type": "application/x-choice", "$value": { "$type": "application/x-string", "$enum": [ { "$value": "mr", "$title": "Mr." }, { "$value": "mrs", "$title": "Mrs." } ] } }, "firstName": { "$title": "First name", "$displayLength": 12, "$capabilities": "sort,filter,alphaTab", "$type": "application/x-string" }, "lastName": { "$title": "Last name", "$displayLength": 12, "$isMandatory": true, "$capabilities": "sort,filter,alphaTab", "$links": { "$details": { "$type": "application/json;vnd.sage=syracuse", "$url": "{$baseUrl}/{$pluralType}('{$key}')?representation={$representation}.$details&role={$role}" } }, "$type": "application/x-string" }, "active": { "$title": "Active", "$capabilities": "sort,filter", "$type": "application/x-boolean" }, "authentication": { "$title": "Authentication", "$capabilities": "sort,filter,alphaTab", "$type": "application/x-choice", "$value": { "$type": "application/x-string", "$enum": [ { "$value": "", "$title": "Standard" }, { "$value": "db", "$title": "DB" }, { "$value": "ldap", "$title": "LDAP" }, { "$value": "oauth2", "$title": "OAuth2" } ] } }, "authenticationName": { "$title": "Authentication name", "$capabilities": "sort,filter,alphaTab", "$type": "application/x-string" }, "email": { "$title": "Email", "$displayLength": 30, "$capabilities": "sort,filter,alphaTab", "$type": "application/x-string", "$format": "$email" }, "photo": { "$title": "Photo", "$capabilities": "", "$type": "image", "$url": "{$baseUrl}/{$pluralType}('{$key}')/photo" }, "infov6": { "$title": "Connection information for V6", "$capabilities": "sort,filter", "$type": "application/x-boolean" }, "userv6": { "$title": "User", "$capabilities": "sort,filter,alphaTab", "$type": "application/x-string" }, "changePassword": { "$title": "Require password change", "$capabilities": "sort,filter", "$type": "application/x-boolean", "$isNullable": true }, "explorer": { "$title": "Explorer", "$capabilities": "sort,filter", "$type": "application/x-graph", "$format": "d3.nodeChart", "$url": "{$baseUrl}/{$pluralType}('{$key}')/$graphs/explorer", "$linkCategories": [ { "$name": "groups", "$title": "Groups" }, { "$name": "groups.endPoints", "$title": "Endpoints" }, { "$name": "groups.role", "$title": "Role" }, { "$name": "adminTeams", "$title": "Teams administrator" }, { "$name": "authorTeams", "$title": "Teams author" }, { "$name": "memberTeams", "$title": "Teams member" } ], "$nodeCategories": [ { "$name": "user", "$title": "Users", "$selected": true, "$prototype": { "$properties": { "$value": "{login}" } } }, { "$name": "group", ``` -------------------------------- ### Display Help for LauncherSolution Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/configuration-console_console This command displays the help information for the `LauncherSolution.exe` utility, detailing available options and their usage. It's the primary way to get an overview of the tool's capabilities. ```bash LauncherSolution.exe /help ``` -------------------------------- ### Example GET Request and Response Payload Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/api-guide_api-get-query_representation=REPRESENTATION This example shows a concrete HTTP GET request to retrieve a list of endpoints with a count limit, followed by the JSON payload structure of a successful response. The response includes metadata and the resources array. ```http http://my_server:8124/api1/syracuse/collaboration/syracuse/endPoints?representation=endPoints.%24query&count=100 ``` ```json { "$url": "http://my_server:8124/api1/syracuse/collaboration/syracuse/endPoints?representation=endPoints.%24query&count=100", "$descriptor": "endPoints", "$startIndex": 1, "$itemsPerPage": 100, "$totalResults": 3, "$ui": {}, "$resources": [ { "$uuid": "20a5550c-5412-476d-a4ad-2c85074176ea", "$key": "20a5550c-5412-476d-a4ad-2c85074176ea", "$url": "/api1/syracuse/collaboration/syracuse/endPoints('20a5550c-5412-476d-a4ad-2c85074176ea')?representation=endPoint.$details", "$etag": 1, "$creUser": "admin", "$creDate": "2013-12-07T13:44:21.304Z", "$updUser": "admin", "$updDate": "2013-12-07T13:44:21.304Z", "$properties": { "databaseDriver": { "$isMandatory": false, "$isHidden": true }, "menuProfileToRoles": { "$isHidden": false } }, "description": "SEED folder on demo Syracuse solution", "application": "x3", "contract": "erp", "protocol": "x3", "dataset": "SEED", "databaseDriver": "mongodb", "x3ServerFolder": "SEED", "x3SolutionName": "DEMOSYR", "applicationRef": { "$uuid": "46976d3e-127f-4e66-9cf0-c8fb985b4aa0", "$key": "46976d3e-127f-4e66-9cf0-c8fb985b4aa0", "description": "X3 ERP" }, "x3server": {}, "$value": "SEED folder on demo Syracuse solution" } ], "$links": { "$excel": { "$url": null, "$title": "Excel", "$type": "application/syracuse-excel-worksheet" } }, "$template": {} } ``` -------------------------------- ### Install Module from Local Repository Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_install-PowerShell-module-offline This command installs a specified module from the local repository to all users on the system. Replace `` with the actual name of the module you wish to install, for example, 'SqlServer'. The `-verbose` flag provides detailed output during the installation process. ```powershell Install-Module -Name -Repository Local -scope allusers -verbose ``` -------------------------------- ### Sage X3 Print Server Service Configuration Examples Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/configuration-console_console Illustrates how multiple Sage X3 Print Server instances can be configured and run on the same host, each associated with a specific profile. These examples show the service names, display names, and the executable path with its configuration parameter. ```text SAFE_X3_SE_V2DEFAULT Safe_X3_SrvEdt_V2_EDT_DEFAULT c:\Sage\SafeX3\EDTV2\EDTSRVFRDEP\srvedit\AdxSrvImp.exe /cfg:DEFAULT SAFE_X3_SE_V2FRA Safe_X3_SrvEdt_V2_EDT_FRA c:\Sage\SafeX3\EDTV2\EDTSRVFRDEP\srvedit\AdxSrvImp.exe /cfg:FRA SAFE_X3_SE_V2PREVIEWS Safe_X3_SrvEdt_V2_EDT_PREVIEWS c:\Sage\SafeX3\EDTV2\EDTSRVFRDEP\srvedit\AdxSrvImp.exe /cfg:PREVIEWS ``` -------------------------------- ### Directory Whitelist Configuration Example (JSON) Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_sandbox-configuration-file An example entry for the `directories` section, specifying a path, allowed file extensions, and write permissions. This serves as a whitelist for file system access. ```json { "path": "xxxx/runtime/cfg", "extensions": [ "json" ] } ``` -------------------------------- ### Example API GET Request for Storage Volume Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/api-guide_api-get-details An example HTTP GET request to retrieve the details of a storage volume identified by its UUID. This demonstrates the practical application of the general syntax, showing how to specify the server, service, endpoint, entity, key, and representation. The expected result is a JSON payload containing the storage volume's details. ```text http://my_server:8124/syracuse/collaboration/syracuse/storageVolumes(('32..8a')?representation=storageVolume.$details ``` -------------------------------- ### Spawn Command Whitelist Configuration Example (JSON) Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_sandbox-configuration-file An example entry for the `spawn` section, defining a command path, a regular expression pattern for the command, and associated parameter modes for read/write access. ```json { "path": "…", "pattern": "…" "params": […], "modes": […] } ``` -------------------------------- ### Example: Instance and File Buffer Transfer Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_setinstance This code example demonstrates how to create a customer instance and then use Setinstance to transfer data from a read customer record in the [CUST] file buffer to the instance. ```Sage X3 Language # Instance pointer on a customer class Local Instance MY_CUSTOMER Using C_CUSTOMER Local File CUSTOMERS [CUST] # Let's create a instance in memory for a customer MY_CUSTOMER = NewInstance C_CUSTOMER AllocGroup Null # Let's read a customer record, and transfer the data in the instance created Read [CUST]CODE="CUST1234" SetInstance MY_CUSTOMER With [F:ORD] ``` -------------------------------- ### Start AWS SOAP Pool Example (REST API) Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/administration-reference_soapClassicPool An example of starting the 'AWS' SOAP pool using a POST request. It demonstrates the required URL structure and the format for the Basic Authorization header, which includes encoded username and password. ```http POST http://localhost:8124/api1/syracuse/collaboration/syracuse/soapClassicPools(alias eq 'AWS')/$service/start Authorization: Basic YWRtaW46YWRtaW4= ``` -------------------------------- ### Automated MongoDB Installation with Response File Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_MongoDB-installation-procedure This command executes an automated MongoDB installation using a pre-configured XML response file. Ensure that the path to 'java.exe' is set in your environment variables and 'setup.jar' is accessible in the current directory. ```Shell java -jar setup.jar file_name.xml ``` -------------------------------- ### Sage X3 Main Runtime XML Configuration Example Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/configuration-console_console An example XML configuration file for a Sage X3 runtime. This defines solution and module details, including runtime status, paths, platform, server information, and specific settings for ADX and ODBC. ```xml myhost.sagefr.com c:\Sage\LOCAL95\dossiers active LOCAL95 c:\Sage\LOCAL95\runtime WIN64 myhost.sagefr.com R095.001.00183 fra 20130 CRYPT:encryptedPassword \sageX3 False C:\Program Files\PowerShell\7\pwsh.exe ``` -------------------------------- ### Sage X3 Openi Examples Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_openi Demonstrates practical applications of the `Openi` command, including opening files with seek offsets, closing files, accessing files on different servers, and opening multiple files with unique abbreviations. ```Sage X3 Script # Let's open a file on the server, skipping the first 10 characters Openi "C:\\Temp\\my_file.txt",10 ... # Close the last file opened to read Openi # Opening a file on the "distrib" server Openi "distrib@"+[L]NOMFIC # Open two files located in the TMP sub-directory of the folder directory on the application server Openi filpath('TMP','rdfile1','') Using [YYY] Openi filpath('TMP','rdfile2','') Using [ZZZ] # Close the two previously opened files Openi Using [YYY] Openi Using [ZZZ] ``` -------------------------------- ### Sage X3 Get$ - Extract Number from JSON Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_get%24 This example illustrates extracting a numerical value from a JSON document using the Get$ function. It parses a JSON string containing a number, then uses Get$ to retrieve the numerical value associated with the '/foo' key and stores it in the MYINT variable. ```Sage X3 Script Funprog Get_Int() Local Cblfile SRCJSON SRCJSON = '{"foo": 42, "bar":"abc"}' Local Instance OBJ using Object ParseInstance OBJ with SRCJSON Local Boolean MYINT Local Boolean R R = OBJ.GET$("/foo", MYINT) FreeGroup OBJ End MYINT -> Returns 42 ``` -------------------------------- ### Example: Allocating Customer and Sales Rep Instances Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_newinstance This example illustrates the practical application of NewInstance to allocate a customer and a sales representative instance. It shows how to place them in the same or separate allocation groups and demonstrates freeing the entire group. ```Sage X3 ERP Script # Declare customer and sales rep instance Local Instance MY_CUSTOMER Using C_CUSTOMER Local Instance MY_SALESREP Using C_SALESREP # Allocate them in the same allocation group MY_CUSTOMER = NewInstance C_CUSTOMER AllocGroup Null MY_SALESREP = NewInstance C_SALESREP AllocGroup MY_CUSTOMER ... # Free them FreeGroup MY_CUSTOMER : # FreeGroup MY_SALESREP would have the same effect ``` -------------------------------- ### Sage X3 Get$ - Extract String from JSON Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_get%24 This example demonstrates how to use the Get$ function to extract a string value from a JSON document. It parses a JSON string into an object and then uses Get$ with a JSON pointer to retrieve the value associated with the '/bar' key, storing it in the MYSTR variable. ```Sage X3 Script Funprog Get_Str() Local Clbfile SRCJSON SRCJSON = '{"foo": "bar", "bar": "abc"}' Local Instance OBJ using Object ParseInstance OBJ with SRCJSON Local Char MYSTR(56) Local Boolean R R = OBJ.Get$("/bar", MYSTR) FreeGroup OBJ End MYSTR -> Returns "abc" ``` -------------------------------- ### Example menueng File Excerpt Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_print-server-presentation-and-operation-guide This is an excerpt from the 'menueng' file, demonstrating how menu items and their associated labels are structured. It shows numerical message IDs followed by their corresponding text descriptions. ```plaintext 1 NO No Yes | 2 RCMAD>< Previous > Last X Sel Table # Code Page + Page - End Ex | 3 123 Yes / No Total / Inquiry Object | 4 DOH Decimal Octal Hexadecimal | 5 35 3 ½ inches 5 ¼ inches ``` -------------------------------- ### Sage X3 Get$ - Extract Boolean from JSON Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_get%24 This example shows how to extract a boolean value from a JSON document using the Get$ function. It parses a JSON string containing a boolean value, then uses Get$ to retrieve the boolean value associated with the '/foo' key and stores it in the MYBOL variable. ```Sage X3 Script Funprog Get_Bol() Local Clbfile SRCJSON SRCJSON = '{"foo": true, "bar": "abc"}' Local Instance OBJ using Object ParseInstance OBJ with SRCJSON Local Char MYBOOL Local Boolean R R = OBJ.Get$("/foo", MYBOL) FreeGroup OBJ End MyBol -> Returns 1 ``` -------------------------------- ### Example Menu File Contents Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_print-server-presentation-and-operation-guide This snippet displays a sample listing of files found within a Sage X3 menu directory. It includes files for various languages (e.g., menueng, menufra) and their corresponding translatable text files (e.g., textraeng, textrafra). ```shell menuarb menuaus menubra menubri menuchi menueng menufra menuger menuita menupol menupor menus menuspa textraarb textraaus textrabra textrabri textrachi textraeng textrafra textrager textraita textrapol textrapor textraspa ``` -------------------------------- ### Openio Function Syntax and Examples - Sage X3 Language Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_openio Demonstrates the various syntaxes for the Openio function, including opening files with and without specific abbreviations, specifying file paths, and setting initial write positions. Also includes examples of closing files. ```Sage X3 Language Openio Openio Using [ABBREVIATION] Openio FILE_EXPR Openio FILE_EXPR Using [ABBREVIATION] Openio FILE_EXPR, SIZE_EXPR Openio FILE_EXPR, SIZE_EXPR Using [ABBREVIATION] ``` ```Sage X3 Language # Let's open a file on the server to append data to it Openio "C:\\Temp\\my_file.txt",-1 ... # Close the last file opened to read Openio # Opening a file on the "distrib" server in read write mode and an initial position at the beginning Openio "distrib@"+[L]NOMFIC # Open two files located in the TMP sub-directory of the folder directory on the application server # The initial position is at byte 1024. Openio filpath('TMP','rdfile1',''),1024 Using [YYY] Openio filpath('TMP','rdfile2',''),1024 Using [ZZZ] # Close the two previously opened files Openio Using [YYY] Openio Using [ZZZ] ``` -------------------------------- ### Uninstall Sage X3 Services using PowerShell Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_Sage-X3-Services-installation This PowerShell command is used to uninstall any running Sage X3 Services from a previous installation folder. It requires administrator privileges to execute. ```powershell PS D:\SageX3\x3-services> .\uninstall.ps1 ``` -------------------------------- ### Execute Runtime Configuration with LauncherSolution.exe Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/configuration-console_console This command executes the Sage X3 configuration engine to set up a full runtime environment. It requires the path to the configuration file, the desired runtime mode ('full'), account credentials, and a log file path. Ensure all parameters are correctly specified for successful execution. ```command-line LauncherSolution.exe /target:'x3configureEngine.xml' /full /account:'host=matrixw16sql17.sagefr.adinternal.com;user=sagefr\qualityAdmin;pass=CRYPT:verkRgrsw3XXXXXXVr;port=1895;' /logfile:'x3configureEngine.tra' ``` -------------------------------- ### Sage X3 Application XML Configuration Example Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/configuration-console_console An example XML configuration file for a Sage X3 application. This file defines solution properties, server details, and module-specific settings like folders, HTTP aliases, and component versions. ```xml myhost.sagefr.com c:\Sage\LOCAL95\dossiers c:\Sage\LOCAL95\dossiers\X3 PRM /Adonix_LOCAL95 false 80 myhost.sagefr.com:80/Adonix_LOCAL95 false active LOCAL95 c:\Sage\LOCAL95\dossiers WIN64 myhost.sagefr.com R090 ``` -------------------------------- ### Sage X3 ERP: Copy File Subprogram Example Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_adxseek This example demonstrates copying a text file line by line, prepending each line with its byte position in the original file. It utilizes adxseek to get the read pointer before reading each line and the write pointer after writing to get the total file size. It handles files opened without abbreviations. ```Sage X3 ERP Script Subprog COPYFILE(PATH1,PATH2,FILE_SIZE) Variable Char PATH1(),PATH2() Variable Integer FILE_SIZE Local Integer I Local Char BUFFER(250) Openi PATH1,0 Openo PATH2,0 adxifs = '' : adxirs = chr$(10) : I = 1 Repeat I=adxseek(0) Rdseq BUFFER If fstat=0 Wrseq "["+num$(I)+"]"; Wrseq BUFFER Endif Until fstat=0 I=adxseek(1) Openi : Openo End I ``` -------------------------------- ### Configure Sage X3 Main Runtime with LauncherSolution.exe Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/configuration-console_console This snippet shows how to use LauncherSolution.exe to configure the MAIN runtime for Sage X3. It requires a target XML file for runtimes and account credentials, logging the process to a file. ```command-line "C:\Sage\SafeX3\Safe X3 Console\LauncherSolution.exe" -target:'C:\Sage\x3ConfigureRUNTIMEs.xml' /main ^ -account:'host=myhost.sagefr.com;user=.\sageX3;pass=ENTER_THE_ACCOUNT_PASSWORD;port=1895;' -logfile:'x3ConfigureRUNTIMEs.tra' ``` -------------------------------- ### Retrieving Customer Details Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/api-guide_api-requests Example of how to get detailed information about a specific customer. ```APIDOC ## GET /x3/$$prod/{folder}.BPCUSTOMER/{key} ### Description Retrieves detailed information about a specific customer. ### Method GET ### Endpoint `.../x3/$$prod/DEMO.BPCUSTOMER('MARTIN')` ### Query Parameters - **representation** (string) - Required - Specifies the representation and facet, e.g., `BPCUSTOMER.$details`. ``` -------------------------------- ### Initialize Context with ACTX_INIT_LAN (Sage X3) Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/developer-guide_context Provides an example of creating and initializing a new context instance using the `ACTX_INIT_LAN` method. This method is used to set up a context for a specific folder, language, and user. ```Sage X3 Script # Creating a new context on the same folder as the standard one but with another user code and language Local Integer ERROR_CODE Local Instance MY_CONTEXT_INSTANCE Using C_WMACONTEXT MY_CONTEXT_INSTANCE = NewInstance C_WMACONTEXT AllocGroup Null ERROR_CODE = fmet MY_CONTEXT_INSTANCE.ACTX_INIT_LAN(GACTX.FOLDER,"GER","JOHNDOE") If ERROR_CODE = 0 # successful Elsif ERROR_CODE < 0 # warning Else # error Endif ``` -------------------------------- ### Install SQLServer PowerShell Module on Linux Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/configuration-console_console These commands install PowerShell 7.2 and the SQLServer module on Linux systems. This setup is required for configuring Microsoft Azure ElasticPool databases with X3 Runtime R095 or higher. ```bash sudo yum install -y powershell sudo pwsh -Command 'Install-Module -Name SqlServer -Scope AllUsers -force' ``` -------------------------------- ### Navigate to output directory Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/how-to_how-to-install-several-node-servers After certificate generation, this command changes the current directory to 'output' where the newly created certificate and key files are stored. This is a prerequisite for copying these files to the secondary server. ```batch cd output ``` -------------------------------- ### Insa Function Example: Initial Insertion Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_insa This example demonstrates the Insa function inserting 2 elements starting from index 1 into three arrays: COMPOSER, NAME, and BIRTH_YEAR. The last elements of the arrays are lost due to the insertion. ```Sage X3 Language Insa 1,2 COMPOSER, NAME, BIRTH_YEAR ``` -------------------------------- ### Basic Sandbox Configuration for Sage X3 ERP Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_sandbox-configuration-file This JSON configuration defines a basic sandbox environment for Sage X3 ERP. It specifies directories that can be accessed and their write permissions, along with a general pattern for spawn commands. This configuration is permissive and does not extensively restrict harmful commands. ```json { "sandbox": { "directories": [ { "path": "c:\\program files\\Sage X3\\runtime\\log", "writable": true, "extensions": ["log","tra"] }, { "path": "D:\\Sage_X3\\Folders", "extensions": ["*"] }, { "others" : "D:\\Sage_X3\\\Tmp", "writable": true, "extensions": ["*"] }, { "path": "D:\\Othervolumes", "volume": "A", "extensions": ["*"] } ], "spawn": [ { "pattern": ".*", "path": "*" } ], "allowConsole" : false } } ``` -------------------------------- ### Retrieving Endpoint Details Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/api-guide_api-requests Example of how to get detailed information about a specific endpoint using its unique ID. ```APIDOC ## GET /syracuse/collaboration/syracuse/endPoints/{id} ### Description Retrieves detailed information about a specific endpoint by its unique ID. ### Method GET ### Endpoint `.../syracuse/collaboration/syracuse/endPoints('5cceca60-c5a2-4ddf-b248-426fc5ce7cfb')` ### Query Parameters - **representation** (string) - Required - Specifies the representation and facet, e.g., `endPoint.$details`. ``` -------------------------------- ### JSON Item Example for Group Entity in Sage X3 ERP Export Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/how-to_how-to-transfer-administration-data This JSON object shows an example of a 'group' entity within the 'item' section of an export file. It details the entity type, its description, and the assigned role for the group. ```JSON { "$type": "group", "description": "description_9ef06d69-dc47-4f73-ad45-a18e569aacf2", "role": "ADMIN_ROLE" } ``` -------------------------------- ### Configure Sage X3 Database with LauncherSolution.exe Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/configuration-console_console This command executes the Sage X3 configuration tool to set up the database. It requires parameters for the target XML file, database level, account details, and a log file. The return code indicates success ('0') or failure. ```batch "C:\Sage\SafeX3\Safe X3 Console\LauncherSolution.exe" -target:'d:\Sage\x3ConfigureDATABASE.xml' -database:3 ^ -account:'host=myhost.sagefr.com;user=.\sageX3;pass=ENTER_THE_ACCOUNT_PASSWORD;port=1895;' -logfile:'x3ConfigureDATABASE.tra' ``` -------------------------------- ### Get Sage X3 Installation Directory (4GL) Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/4gl_dir%24 The `dir$` function in 4GL returns the path to the directory where the Sage X3 runtime engine is installed on the process server. The result is of type Char. Ensure no open channels are unavailable to avoid execution errors. ```4GL Local Char INSTALLDIR(200) INSTALLDIR=dir$ ``` -------------------------------- ### Sage X3 Print Server Server Name Example Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_print-server-presentation-and-operation-guide Shows an example of the `_PrinterServer` parameter, indicating the hostname and port of the Sage X3 Print Server software that will handle the print job. ```plaintext _PrinterServer=vcsx3v11.sagefr.adinternal.com:1890 ``` -------------------------------- ### OSQL Command Execution Setup (Shell) Source: https://online-help.sagex3.com/erp/12/fr-fr/Content/V7DEV/getting-started_sandbox-configuration-file Patterns for setting the OSQL executable path and conditionally updating it if a specific version exists. This is crucial for database operations. ```shell pattern: "^SET OSQL_EXE=osql" ``` ```shell pattern: "IF EXIST \"%SQLS7_OSQL%\\BINN\\osql.EXE\" SET OSQL_EXE=\"%SQLS7_OSQL%\\BINN\\osql.EXE\"" ``` ```shell pattern: "%OSQL_EXE% -D [ A-Z0-9>\\.\\_:\"\\-@#!\$%&'\\(\\)*\\+/;<=?\\[\\]\\^`{\\|}~]*" ```