cmEngage Hub

cmEngageHub Configuration Guide

Overview

The Activity Panel is a configurable component that displays various types of activities (Tasks, Events, Notes, Emails, SMS, eForms) in a unified timeline. The configuration is managed through four Custom Metadata records under the Activity_Panel_Configuration__mdt type that control buttons, activity record display, form schemas, and default filters.


1. Activity Buttons Configuration

This configuration controls the action buttons displayed in the activity panel header. Buttons are split into two groups: toolbar buttons rendered directly in the header, and dropdown items accessed through the More Actions menu.

Configuration Structure

{
  "buttonMapping": [
    {
      "name": "log_a_call",
      "label": "Log a Call",
      "iconName": "standard:log_a_call",
      "class": "slds-m-right_xx-small",
      "modalClass": "",
      "order": 1,
      "isDropdown": false
    },
    {
      "name": "secure_email",
      "label": "Send Secure Email",
      "iconName": "standard:email",
      "class": "slds-m-right_xx-small timeline-email",
      "screenFlowName": "Send_Secure_Email",
      "modalClass": "slds-modal slds-fade-in-open slds-modal_medium",
      "parameterName": "contactId",
      "isDropdown": true
    }
  ]
}

Button Properties

Property

Type

Required

Description

Example

name

String

Yes

Unique identifier used internally for routing. Hardcoded names (log_a_call, task, event, note) open built-in modals. Any other name with a screenFlowName launches a Flow.

"log_a_call"

label

String

Yes

Display text shown on the button and as the modal heading

"Log a Call"

iconName

String

Yes

SLDS icon API name

"standard:log_a_call"

class

String

Yes

CSS classes applied to the icon element

"slds-m-right_xx-small"

modalClass

String

Yes

SLDS modal size class used when the button launches a Flow modal

"slds-modal slds-fade-in-open slds-modal_medium"

order

Number

Yes (for toolbar buttons)

Display order for non-dropdown buttons. Lower numbers appear first. Not used for dropdown items.

1

isDropdown

Boolean

Yes

false places the button in the toolbar. true places it in the More Actions dropdown menu.

false

screenFlowName

String

No

API name of the Screen Flow to launch. When present, clicking this button opens a Flow instead of the built-in modal.

"Send_Secure_Email"

parameterName

String

No

The Flow input variable name that receives the current record Id when the Flow is launched.

"contactId"

hiddenFor

Array

No

Visibility rules. Hides the button on specific objects or record types. See Visibility Rules section below.

See below

Button Visibility Rules (hiddenFor)

The hiddenFor property allows a button to be hidden conditionally based on the current record's object type and record type.

{
  "name": "task",
  "label": "New Task",
  "isDropdown": false,
  "hiddenFor": [
    {
      "objectName": "Case",
      "recordTypes": []
    },
    {
      "objectName": "Account",
      "recordTypes": ["Partner_Account", "Customer_Account"]
    }
  ]
}

hiddenFor Property

Type

Description

objectName

String

The object API name this rule applies to

recordTypes

Array

List of Record Type Developer Names to hide for. If empty, the button is hidden for ALL record types on this object.

Visibility Logic

hiddenFor is empty or null
        └── Button is always visible

hiddenFor has entries
        └── No entry matches current object
                └── Button is visible

        └── Entry matches current object
                ├── recordTypes is empty
                │       └── Button is HIDDEN for this object regardless of record type
                └── recordTypes is NOT empty
                        ├── Current record type IS in the list   →  Button is HIDDEN
                        └── Current record type NOT in the list  →  Button is visible

Button Types

Standard Buttons (isDropdown: false)

These open a built-in modal form. The name field must exactly match one of the reserved keys below.

Name

Label

Action

log_a_call

Log a Call

Creates a Task with TaskSubtype = Call and Status = Completed

task

New Task

Creates a Task with TaskSubtype = Task and Status = Not Started

event

New Event

Creates an Event pre-populated with the next full hour as start time

note

New Note

Creates a ContentNote linked to the current record

Flow-based Buttons (isDropdown: true, with screenFlowName)

These launch a Salesforce Screen Flow. The screenFlowName must match the Flow API name in your org. The current record Id is passed into the Flow using the parameterName variable.

Name

Label

Flow API Name

Parameter Passed

secure_email

Send Secure Email

Send_Secure_Email

contactId

secure_sms

Send SMS

Send_SMS

parentId

send_eform

Send eForm

Send_eForm

parentId

Flow-based buttons render differently on mobile vs desktop. On desktop they open inside a medium-sized SLDS modal. On mobile they take over the full screen as a slide-in panel.


2. Activity Record Configuration

This configuration defines which Salesforce objects are shown in the timeline, what fields to query, how the summary and detail rows are displayed, and which parent-child relationships to traverse when fetching activities.

Configuration Structure

{
  "Activity_Record_Configuration": [
    {
      "sObjectName": "Task",
      "fields": "Id, Subject, ActivityDate, Status, Description...",
      "whereClause": "WHERE TaskSubtype IN :ALLOWED_TASK_SUBTYPES...",
      "subject": { "type": "text", "fieldName": "Subject" },
      "summaryTemplate": [],
      "detailTemplate": [...],
      "objectConfig": { ... },
      "icon": "standard:task",
      "iconColor": "#4abf75",
      "bgColor": "#4abf75"
    }
  ],
  "Related_To_Objects": "Account,Opportunity,Case",
  "Record_Lookup_Configuration": { ... }
}

Activity Properties

Property

Type

Description

Example

sObjectName

String

Salesforce object API name to query

"Task"

fields

String

Comma-separated SOQL field list

"Id, Subject, ActivityDate, Status"

whereClause

String

SOQL WHERE clause fragment appended to the base query. Can reference Apex-defined sets like :ALLOWED_TASK_SUBTYPES or :setParentRecordId.

"WHERE TaskSubtype IN :ALLOWED_TASK_SUBTYPES"

subject

Object

Controls how the activity title is derived. See Subject Configuration below.

{ "type": "text", "fieldName": "Subject" }

summaryTemplate

Array

Token list for the inline summary sentence shown below the subject. See Template Elements below.

See below

detailTemplate

Array

Token list for the expanded detail section shown when a row is opened. See Template Elements below.

See below

objectConfig

Object

Defines per-object parent field traversal and child record roll-up. See Object Configuration below.

See below

icon

String

SLDS icon name for the activity type. If omitted, the Apex layer falls back to defaults per sObjectName.

"standard:email"

iconColor

String

Hex color applied to the icon foreground

"#0087ff"

bgColor

String

Hex color applied to the left border of the timeline row

"#0087ff"

Default Activity Type Icons and Colors

sObjectName

Default Icon

Default bgColor

Task (subtype: Task)

standard:task

#4abf75

Task (subtype: Call)

standard:log_a_call

#48c3cc

Event

standard:event

#cb65ff

ContentNote

standard:note

#b60554

Custom objects

Set via icon / bgColor properties

Set via bgColor property

Subject Configuration

Controls how the title of each activity row is derived.

"subject": {
  "type": "text",
  "fieldName": "Subject"
}

"subject": {
  "type": "conditionalText",
  "dependsOn": "RecordType.DeveloperName",
  "conditionalTextConditions": {
    "Outbound_Message": "Outgoing SMS",
    "Inbound_Message": "Incoming SMS"
  },
  "defaultValue": "Outgoing SMS"
}

Subject Type

Description

text

Reads the value directly from fieldName. Falls back to staticValue if fieldName is not set.

conditionalText

Looks up the subject string from conditionalTextConditions map using the value of dependsOn field. Uses defaultValue if no match is found.

Summary Template

Generates the inline summary sentence shown beneath the activity subject (e.g. "You sent an email to James Smith"). Each entry in the array becomes a token in the sentence.

"summaryTemplate": [
  {
    "type": "owner",
    "fieldName": "OwnerId",
    "labelField": "Owner.Name",
    "recordTypesForStatic": ["Inbound"]
  },
  {
    "type": "conditionalGroup",
    "dependsOn": "RecordType.DeveloperName",
    "conditionalGroupConditions": {
      "Outbound": [
        { "type": "text", "staticValue": " sent an email" },
        { "type": "text", "staticValue": " to " },
        { "type": "record", "fieldName": "Parent_Record_Id__c", "labelField": "Parent_RecordName__c" }
      ],
      "Inbound": [
        { "type": "text", "staticValue": " received an email" }
      ],
      "Default": [
        { "type": "text", "staticValue": " sent an email" }
      ]
    }
  }
]

Detail Template

Controls the fields shown in the expanded detail section when a user opens an activity row. Each entry renders as a label-value pair.

"detailTemplate": [
  {
    "type": "link",
    "label": "Sender",
    "href": "mailto:{}",
    "fieldName": "cmsecureemail__FromAddress__c"
  },
  {
    "type": "text",
    "label": "Subject",
    "fieldName": "cmsecureemail__Subject__c"
  },
  {
    "type": "text",
    "label": "Body",
    "fieldName": "cmsecureemail__TextBody__c",
    "scrollable": true,
    "cssClass": "slds-size--1-of-1 slds-p-vertical--xx-small"
  }
]

Template Element Properties (all types)

Property

Type

Applies To

Description

type

String

All

Element type. See type reference table below.

fieldName

String

text, record, owner, link

API name of the field to read. Supports dot-notation traversal (e.g. "Owner.Name", "RecordType.DeveloperName").

labelField

String

record, owner

API name of the field used for the display name of a related record link.

staticValue

String

text

Literal string rendered directly. Used for connectors like " sent an email".

dependsOn

String

conditionalText, conditionalGroup, text (conditional)

API name of the field whose value drives the conditional logic.

conditionalTextConditions

Object

conditionalText

Map of field value to display string.

conditionalGroupConditions

Object

conditionalGroup

Map of field value to a nested array of template items. Must include a "Default" key as fallback.

defaultValue

String

conditionalText

Fallback string when dependsOn value does not match any key.

href

String

link

URL template. Use {} as a placeholder; it is replaced with the field value at runtime (e.g. "mailto:{}", "tel:{}").

label

String

All (detail template)

Label shown above the value in the expanded detail view.

scrollable

Boolean

text

When true, renders the value in a scrollable container (max-height 90px). Use for long text fields like Description or Body.

cssClass

String

All

Overrides the default SLDS grid class. Default is "slds-size--1-of-2 slds-p-vertical--xx-small". Use "slds-size--1-of-1" for full-width rows.

recordTypesForStatic

Array

owner

When the record's Record Type Developer Name is in this list, the owner token always renders as "You" regardless of the actual owner. Used for inbound messages.

Template Element Type Reference

Type

Used In

Renders

text

summaryTemplate, detailTemplate

A plain text span. Reads from fieldName, staticValue, or conditionally from dependsOn.

record

summaryTemplate, detailTemplate

A clickable link that navigates to a Salesforce record. Value comes from labelField, Id from fieldName. Hidden if the field is blank.

owner

summaryTemplate, detailTemplate

Shows "You" if the logged-in user is the owner. Otherwise renders the owner name as a clickable record link.

conditionalText

summaryTemplate, detailTemplate

Renders different text strings based on the value of dependsOn field. Looks up from conditionalTextConditions map.

conditionalGroup

summaryTemplate

Renders a different set of nested template items based on the value of dependsOn field. Used for inbound vs outbound patterns. Requires a "Default" key.

link

detailTemplate

Renders a clickable hyperlink. The href template uses {} as a placeholder for the field value (e.g. mailto:, tel:).

Object Configuration

Defines parent field traversal and child object roll-up per host object. This controls which related records' activities are also included when viewing a record.

"objectConfig": {
  "Account": {
    "parentFields": [],
    "childConfig": [
      {
        "sObjectName": "Contact",
        "relationField": "AccountId",
        "whereClause": ""
      },
      {
        "sObjectName": "Opportunity",
        "relationField": "AccountId",
        "whereClause": ""
      }
    ]
  },
  "Contact": {
    "parentFields": ["AccountId"],
    "childConfig": []
  }
}

Property

Type

Description

parentFields

Array

List of lookup field API names on the current record. Activities linked to the records these fields point to are also included. Example: on a Contact record, "AccountId" means "also fetch activities linked to the parent Account".

childConfig

Array

List of child objects to traverse. For each entry, the system first queries the child object to get all related Ids, then fetches activities linked to those Ids.

childConfig.sObjectName

String

API name of the child object to traverse

childConfig.relationField

String

Lookup field on the child object that points to the current record

childConfig.whereClause

String

Optional additional SOQL filter applied when querying child records

Example roll-up: When viewing an Account, the panel fetches activities linked to the Account directly, plus activities linked to all related Contacts and Opportunities.

Controls which objects appear in the Related To lookup when creating new Tasks and Events.

"Related_To_Objects": "Account,Opportunity,Case"

Property

Type

Description

Example

Related_To_Objects

String

Comma-separated list of object API names

"Account,Opportunity,Case"

These are the objects that appear in the Related To dropdown when a user creates a New Task, New Event, Log a Call, or any follow-up activity. Add or remove API names to control which objects users can relate activities to.

Record_Lookup_Configuration

Pre-populates the Name (Who) and Related To (What) fields when a user creates an activity from a specific record page.

"Record_Lookup_Configuration": {
  "Contact": {
    "whatIdField": "AccountId",
    "whatIdDisplayName": "Account.Name",
    "whoIdField": "Id",
    "whoIdDisplayName": "Name"
  },
  "Case": {
    "whatIdField": "Id",
    "whatIdDisplayName": "CaseNumber"
  }
}

Property

Type

Description

Example

whatIdField

String

Field API name on the current record whose value is used to pre-populate Related To

"AccountId", "Id"

whatIdDisplayName

String

Field path used to resolve the display name for Related To. Supports dot-notation.

"Account.Name", "CaseNumber"

whoIdField

String

Field API name on the current record whose value is used to pre-populate Name/Contact

"Id", "PersonContactId"

whoIdDisplayName

String

Field path used to resolve the display name for Name. Supports dot-notation.

"Name", "PersonContact.Name"

How it works:

When viewing a Contact record:

  • whoIdField = "Id" means the Contact itself is pre-filled in the Name field

  • whatIdField = "AccountId" means the Contact's parent Account is pre-filled in Related To

When viewing a Case record:

  • whatIdField = "Id" with whatIdDisplayName = "CaseNumber" means the Case itself is pre-filled as Related To, displayed by its case number

If an object is not listed in this configuration, the component falls back to:

  • Setting the current record as Who if the object is in the Who-capable set (Contact, Lead)

  • Setting the current record as What if the object is in the Related_To_Objects list


3. Default Activity Filters

This configuration controls the options available in the filter settings modal and the default selections applied when the component first loads.

Configuration Structure

{
  "options": {
    "activityTypeOptions": [
      { "label": "All types",     "value": "All types" },
      { "label": "Events",        "value": "Event" },
      { "label": "Logged calls",  "value": "Call" },
      { "label": "Tasks",         "value": "Task" },
      { "label": "Notes",         "value": "ContentNote" },
      { "label": "Secure Email",  "value": "cmsecureemail__Secure_EmailMessage__c" },
      { "label": "SMS",           "value": "smsefax_guru__SMS_Message__c" },
      { "label": "eForms",        "value": "docgen_esign__Document_Workflow__c" }
    ],
    "dateRangeOptions":        ["All time", "Next 7 days", "Last 7 days", "Last 30 days"],
    "activitiesToShowOptions": ["All activities", "My activities"],
    "sortOrderOptions":        ["Oldest dates first", "Newest dates first"]
  },
  "selectedValues": {
    "selectedDateRange":        "All time",
    "selectedActivitiesToShow": "All activities",
    "selectedActivityTypes":    ["All types"],
    "selectedSortOrder":        "Newest dates first"
  }
}

Filter Options

Option

Type

Description

activityTypeOptions

Array of {label, value} objects

Activity types shown as checkboxes in the filter modal. The value must match either a reserved type key (see below) or the sObjectName of a custom activity type defined in Activity_Record_Configuration.

dateRangeOptions

Array of strings

Date range options shown as radio buttons

activitiesToShowOptions

Array of strings

Ownership filter options shown as radio buttons

sortOrderOptions

Array of strings

Sort direction options shown as radio buttons

Activity Type Values Reference

The value field in activityTypeOptions is what the filter engine uses to match records. Task and Call are special cases because both are Task sObject records differentiated by their TaskSubtype field.

Label

Value

Matches

All types

All types

Special sentinel — selects all other types at once

Events

Event

sObjectName = "Event"

Logged calls

Call

sObjectName = "Task" AND TaskSubtype = "Call"

Tasks

Task

sObjectName = "Task" AND TaskSubtype = "Task"

Notes

ContentNote

sObjectName = "ContentNote"

Secure Email

cmsecureemail__Secure_EmailMessage__c

sObjectName = custom email object

SMS

smsefax_guru__SMS_Message__c

sObjectName = custom SMS object

eForms

docgen_esign__Document_Workflow__c

sObjectName = custom eForm object

Only include values in activityTypeOptions for objects that are also configured in Activity_Record_Configuration. If a value is listed in the filter but the corresponding sObjectName is not in Activity_Record_Configuration, the filter will be shown to users but will have no effect.

All Types Behaviour

User selects "All types"
        └── All individual type checkboxes are automatically checked

User deselects "All types"
        └── All checkboxes are cleared

User checks all individual types manually
        └── "All types" is automatically added

User unchecks one individual type while "All types" is selected
        └── "All types" is removed, remaining individual types stay selected

Default Selections

Setting

Property Key

Default Value

Description

Date range

selectedDateRange

"All time"

Must exactly match one value from dateRangeOptions

Activities to show

selectedActivitiesToShow

"All activities"

Must exactly match one value from activitiesToShowOptions

Activity types

selectedActivityTypes

["All types"]

Array of values. "All types" expands to all individual types on load.

Sort order

selectedSortOrder

"Newest dates first"

Must exactly match one value from sortOrderOptions

Date Range Filter Behaviour

Option

Open Activities (Upcoming & Overdue)

Past Activities

All time

All open activities shown

All past activities shown

Next 7 days

Activities with sortingDate on or before 7 days from today

Not shown

Last 7 days

Open activities within the past 7 days

Past activities within the past 7 days

Last 30 days

Open activities within the past 30 days

Past activities within the past 30 days

Date boundaries are calculated in the user's local timezone (resolved from the logged-in user's Salesforce timezone setting) and then converted to GMT for record comparison. This ensures that "Last 7 days" reflects the correct days relative to where the user is located.


Need Help?

For any questions or support, contact us at support@cloudmaveninc.com