Background

Salesforce explicitly recommends that an SObject should have only one trigger. In our demonstration project, the Accounts trigger exists in the Common implementation.

Situation

The Sales implementation wants to know when the Account object has changes, so that some related business logic can be executed. However given Salesforce's recommendation, Sales should not create a new trigger for its use.

Answer

Using Salesforce's Platform Events feature, the Core implementation provides the PlatformEventDistributor that provides event information to subscribed classes, as defined by the PlatformEvents_Subscription custom metadata type in which Sales placed a record referring to the Sales_PlatformEventsConsumer class.

Details

References: