Code Containers

Code containers are properties of components, application shells, entities and fields that hold the ProcScript and JavaScript code used to define application behavior for the specific object.

Each main development object has two types of code container—one Declarations container and one or two Script containers:

Declarations

Holds constant declarations with object scope. This means that the constant value remains the same for the object and all its subobjects. Thus:

  • A constant defined in the Declarations container of a component is available to all the objects in the component, including its entities and fields.
  • A constant defined in the Declarations container of an entity is available to the entity and its fields.
  • A constant defined in the Declarations container of a field is valid for only that field.
Script

Holds ProcScript modules, and constant declarations with container scope.

This container holds all types of ProcScript module—system and interactive triggers, operations, and entries. In Dynamic Server Pages they can hold web triggers and web operations for client-side execution.

The Script container can also hold constant declarations with container scope. For example, a constant defined in an entity's Collection Script container is not available to the modules in one of its fields.

Entities have two Script containers:

  • Collection Script container—used to define operations or entries that can be called to process a collection of the entity occurrences, for example when storing or clearing data.
  • Occurrence Script container—used to define ProcScript modules that process each occurrence; these include triggers that are executed in response to system events, and operations that can be called to provide occurrence-level processing.
Code Containers in the Script Editor

Code containers are indcated by green headers in the Script Editor

Related Topics