Blog navigation

Últimas entradas del blog

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:

 
Ordenar por:
  • EXEC_JS / streamline.js / Paquetes de Javascript de Sage X3 Syracuse
    EXEC_JS / streamline.js / Paquetes de Javascript de Sage X3 Syracuse

    Sage X3: Superar Limitaciones con el Puente entre 4GL y JavaScript Sage X3 4GL a veces puede presentar limitaciones al desarrollar funciones criptográficas. Para abordar este desafío, Sage ha ideado una solución creando un 'puente' entre 4GL y JavaScript. Este enfoque innovador implica la creación de funciones JavaScript que se pueden integrar sin problemas en el nivel Syracuse dentro del marco de trabajo node.js. Luego, estas funciones pueden ser invocadas desde Sage X3. Esta...

    Read more