How to
Viewing events in the Activity Timeline

Malcolm Jacobson
Malcolm Jacobson
  • Updated

The Pendula managed package adds a custom lookup field, Pendula Message (P4E_Message__c), to the standard Salesforce Event object. This field is populated on every Activity Sync event and provides a direct navigable link from an Event record in the Activity Timeline view, back to the associated Message__c record.


Why This Field Exists

When Activity Sync creates Event records, the standard WhatId field is used to link the event to the Message__c record. However, Salesforce does not allow WhatId to be set when WhoId references a Lead — this is a hard platform constraint.

The P4E_Message__c lookup field works around this by providing an explicit, separate link to the Message__c record that is not subject to the WhoId/WhatId constraint. It is populated for all recipient types:

Recipient TypeWhoIdWhatIdP4E_Message__c
ContactContact IdMessage__c IdMessage__c Id
LeadLead Id(not set)Message__c Id
User(not set)Message__c IdMessage__c Id
Person Account(not set)Message__c IdMessage__c Id

This field also enables correct upsert behaviour for Lead events. Because Lead events have no WhatId, the package uses P4E_Message__c to identify and update existing events rather than inserting duplicates on each status change.


Post-Install Setup

The field is added to the Event object automatically on package installation. In Salesforce metadata, custom fields on activity objects (Event, Task) are stored under the Activity object — this is a platform convention. The field is accessible on Event records as Pendula4E__P4E_Message__c regardless of where it is stored in metadata. To make it visible to users viewing Event records you must manually add it to the relevant Event page layout(s) in your org:

  1. Go to Setup > Object Manager > Event > Page Layouts
  2. Open the page layout(s) used by your sales or service users
  3. Drag the Pendula Message field onto the layout
  4. Save

There is no standard way for a managed package to modify a subscriber org's existing page layouts without risk of overwriting customisations, so this step must be performed by an administrator.


Field-Level Security

The field is included in the following package permission sets with the permissions shown:

Permission SetReadableEditable
Pendula Activity Sync IntegrationYesYes
Pendula Console ViewerYesNo
Pendula Console ComposerYesNo

Users who view Event records but do not have one of the above permission sets assigned will not see the field unless their profile grants access. Grant field-level read access via a profile or supplemental permission set as needed.


Behaviour on Message Deletion

The field uses a SetNull delete constraint. If the referenced Message__c record is deleted, the P4E_Message__c field on any linked Event records is set to null — the Event records themselves are not deleted.


Upgrade Behaviour

For orgs upgrading from a version without this field:

  • Existing Event records will have P4E_Message__c = null
  • The next time a Message__c record is updated (triggering the Activity Sync logic), the corresponding Event is updated and P4E_Message__c is populated at that point
  • Lead events that were previously never updated (due to the missing upsert key) will be correctly updated from that point forward