dms.CreateOsEvent

Creates a new OS event.

This job accesses the internal scripting infrastructure of enaio® directly. Incorrectly configured events can cause unexpected behavior or serious malfunctions on the client or server side.

1. Input Parameters

Name Type Required Description

EventCode

INT

Yes

Event type of the new event.
Complete value description: Event code list

OsClassName

STRING

No

Target object type: type_id as a string or "Application".
Description: Field os_class_name

OsEventParams

STRING

No

Context parameter — content depends on EventCode (field GUID, job name, or library name).
Mapping: os_event_params — Mapping

VBCode

BYTE[]

Yes

Executable script code of the event (JavaScript or VBScript), passed as BYTE[] (BASE64). Encode the bytes as UTF-8 with BOM — the server detects UTF-8 only by the leading BOM and then stores the full Unicode range. Without a BOM the bytes are interpreted as legacy Windows-1252 (cp1252). Applies regardless of is_js and of whether the system is a Unicode system.
Description: Field vb_code

AppClass

STRING

No

Target platform: 1 = Client · 2 = Server · 3 = WebClient.
Mapping: Field app_class

2. Output Parameters

Name Type Dependency Description

OsEventID

INT

ID of the newly created event. Corresponds to the id field in the JSON response of dms.GetOsEvents.

The server enforces uniqueness over the combination of EventCode, OsClassName, and OsEventParams. A call with an already existing combination is rejected (Os event already exists). To change an existing event, use dms.UpdateOsEvent (only vb_code is modifiable) or delete the event and create it anew, depending on what needs to change.

The spelling of the id parameter is not consistent across the OS event jobs: dms.CreateOsEvent returns it as OsEventID, dms.DeleteOsEvent expects it as OsEventID, whereas dms.UpdateOsEvent expects it as OsEventId (lowercase d). Mind the exact spelling.

3. Return Value

(INT): 0 = Job successful, otherwise error code
Complete list of error codes