Versions Compared

Key

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

...

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).

(warning)External calls - Work in progress

The javascript api will soon have the capability to make authenticated calls to external systems. The authentication method and credentials for different external systems will be defined during system start. This part of the javascript api is yet to be finished. The documentation will be updated when this functionality is available.

Expected Return Values for Guard Scripts

...

Structure of the GuardResult Object

Field

Type

Description

success

boolean

Indicates whether the update should proceed.

title

String

A brief title summarizing the guard's outcome.

reason

String

A detailed explanation of the decision.

affectedProperties

List<AffectedProperty>

List of properties that influenced the decision.

AffectedProperty Record

Field

Type

Description

reason

String

Explanation of how the property was affected.

propertyIdentifier

String

The identifier of the affected property.

Example Use Cases

  • Success = True: The update is allowed to proceed, and no details are shown to the user since the operation complies with all rules.

  • Success = False: The update is blocked. The details specified in the GuardResult object, such as title, reason, and information about affectedProperties, will be displayed in the UI to inform the user precisely why the update was not permitted.

...