Object scripts

An object script is one that monitors changes to an objects and runs asynchronously after the action has been carried out.

The scripts can be set up in the script manifest like:

 {
      "name": "CreateBooking",
      "description":"Called when a booking is created",
      "type":"Bookings",
      "actions": ["after_create"],
      "log_type": "Tail",
      "enabled": true,
      "handler": "create_booking"
    }

The type is always the object name and the actions are the callbacks to trigger on

A full list of currently supported types and actions is:

TypeActions
Bookingsafter_create, after_update, after_deleteA customer appointment booking record
Clientsafter_create, after_updateA customer record
Calendar Slotcreate_calendar_entry, delete_calendar_entry, move_calendar_entry, update_calendar_entryA Timeslot in a staff members or resources calendar
EventChainafter_create, after_updateA single or series of events has been created or updated
Slotafter_create, after_updateA staff timeslot - which could be a booking or an occurrence of an event