Blog navigation

Derniers articles

Javascript

A standard API is available in X3 scripts to perform calls to the platform's javascript published functions. It works on code executed from classic pages as well as on V7 (and later) code.

The execution of functions is performed on node.js in javascript. A function can be synchronous or asynchronous. When a function is asynchronous, a parameter of the function defines the callback function; i.e., the function that is called when the execution of the asynchronous function is finished. We use the package streamline.js to make the use of asynchronous functions simple, by adding an "_" parameter that is preprocessed to handle the callback.

This means that if the function has been defined as asynchronous, you have to use the 'wait' value for MODE, and to indicate the place of the callback parameter as it is declared in the function. The values of these parameters will be mentioned in the function definition.

The function fills RESBODY and RESHEAD, and returns the HTTP status (200 if successful).

The complete JSON structure returned is stored in RESBODY as a stringified JSON. If you want to get only one element in the structure, you have to give its name (if it is a property at the first level of the hierarchy) or the path (if it is a nested property). If the property is a single one, it will be returned in a string, otherwise you will get the JSON description of the requested sub-element.

For example, if the function returns a JSON like the following one:

 
Trier par:
  • EXEC_JS / streamline.js / Bundles Javascript de Sage X3 Syracuse
    EXEC_JS / streamline.js / Bundles Javascript de Sage X3 Syracuse

    Sage X3 : Surmonter les Limitations grâce au Pont entre 4GL et JavaScript Parfois, Sage X3 4GL peut présenter des limitations lors du développement de fonctions cryptographiques. Pour contourner ce défi, Sage a élaboré une solution en créant un « pont » entre le 4GL et JavaScript. Cette approche innovante implique la création de fonctions JavaScript qui peuvent être intégrées de manière transparente au niveau Syracuse dans le framework node.js. Ces fonctions peuvent ensuite être...

    Read more