update_os_event()

Updates the script code of an existing OsEvent via dms.UpdateOsEvent.

Only the script code (vb_code) can be changed. The event code, target object type, context parameter, and platform are immutable. To change any of those, delete the event with delete_os_event() and recreate it with create_os_event() — which yields a new id.

1. Signature

  • Sync

  • Async

ecm.system.update_os_event(
    os_event_id: int,
    script: str,
) -> None
await ecm.system.update_os_event(
    os_event_id: int,
    script: str,
) -> None

2. Parameters

Parameter Type Default Description

os_event_id

int

Id of the event to update (the id field of an ECMOsEvent).

script

str

The new script code (JavaScript or VBScript). Stored by the server in the Windows-1252 (cp1252) code page; characters outside cp1252 raise UnicodeEncodeError.

3. Return value

None (None). A server error raises an exception.

4. Examples

  • Sync

  • Async

ecm.system.update_os_event(9, "'updated script")
await ecm.system.update_os_event(9, "'updated script")

5. See also