Integrating Activities using UEF record-level events

Use UEF to create record-level events to integrate Task and Appointment child records that users open from a Case or Service Request page.

Tasks and Appointments are child objects of Case or Service Request records. First register a record-level event listener for the parent record. When a user opens a Task or Appointment create or edit page, the parent listener receives information that identifies the child record.

Use the child-record information to get its UEF context. You can then get or set field values, save the record, validate it before save, respond after save, detect field changes, sync external systems, and apply business logic.

Supported Objects

  • Task
  • Appointment

Supported Events

Event Description
OnChildRecordOpen Triggered when a Task or Appointment create or edit page is opened. Because Tasks and Appointments are child objects of Case or Service Request, register the listener through the parent object’s record-level event listener. The parent event provides the child-record details needed to obtain the UEF context for the Task or Appointment.
OnBeforeSave Fired once the Create or Update button is pressed in the supported pages. This supports async and the save operation can be aborted by returning { stopPropagation: true } from the action chain.
OnAfterSave Fired once save operation is completed. The event.data has information of the object after create or save.
FieldValueChange Fired when a field's value is updated. For fieldValueChange event, the event.data is an array of objects. Each object contains the updated field name, new value and old value.

Supported Actions

Action Description
Set field value Updates the value of a particular field of a particular record or object.
Get field value Retrieves the current value of a field from the open Task or Appointment record.
Save operation Saves the open Task or Appointment record. The response of SaveRecordOperation will give information about the oldObjectId and actual object identifier after save.

Integration Flow

Use the following sequence when integrating Task or Appointment records:

  1. Get the UEF context for the parent Case or Service Request.
  2. Register an OnChildRecordOpen listener on the parent record.
  3. Create a listener for the recordLevelEvent event.
  4. When OnChildRecordOpen occurs, obtain the child record’s objectId and objectType.
  5. Pass those values to getRecordByContext.
  6. Use the returned child-record context to perform supported actions.
  7. Register FieldValueChange, OnBeforeSave, and OnAfterSave listeners for the child record.