Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The JavaScript execution is designed for integration with "concept types" through two specific script functionalities:

  • Guard Scripts: These scripts act as safeguards for updates to the concepts. They are saved as part of the concept type. They evaluate conditions and determine whether an update should proceed or be rejected.

  • Calculated Fields Scripts: These scripts perform operations such as calculations, concatenations, and other manipulations. The results can then be displayed in the concept.

API Capabilities

The internal JavaScript API exposes several objects and functionalities to the executing scripts, enabling them to interact deeply with the system's internal structures. This interaction includes access to persisted concepts in the current context, master data, the current user, and, in specific cases, the potential future state of a concept (for Guard Scripts) or the fields dependent on calculations (for Calculated Fields Scripts).

...

To access the webClient, use the following syntax:

Deprecated - still works but it is no longer required to specify the method and url when getting the webclient

Code Block
languagejs
let webClient = context.getWebClient("GET", "https://host.com/some-uri");
  • Method: The first argument specifies the HTTP method (GET, PUT, POST, DELETE).

  • URI: The second argument is the URI to which the request will be sent.

Simple way

Code Block
languagejs
let webClient = context.getWebClient();

...

This object provides similar methods to those available in the Concept object for accessing properties and records (see here):

  • Property Access Methods: Includes methods to retrieve simple properties in various data types (e.g., getProperty(String key), getPropertyAsInt(String key), etc.).

  • Complex Property (Record) Access Methods: Includes methods to access complex properties or records such as getComplexProperty(String recordTypeKey) which retrieves a list of complex properties (records) based on the record type key.

...