Skip to main content

Apex classes

This page provides information about the globally exposed Apex classes in that you can reference and use.

Notification Log Service

The Notification Log Service (SE_NotificationLogService) Apex class creates notification logs (mvn__SE_Notification_Log__c) records for all emails and Salesforce notifications that are sent out regardless of the user's sharing rules. This can be used to create notification logs for any activities that are not part of Scientific Publications Cloud product.

global without sharing class SE_NotificationLogService implements SE_INotificationLogService

Method(s)

logEmailMessages(emails, results)

global void logEmailMessages(List\<Messaging.SingleEmailMessage\> emails, List\<Messaging.SendEmailResult\> results)

DescriptionThis method logs the emails that were sent out and their delivery statuses.
Returnsvoid
ParameterTypeDescription
emailsList<Messaging.SingleEmailMessage>The list of standard Single Email Message (Messaging.SingleEmailMessage) records to be logged. These contain the content of the emails that were sent.
resultsList<Messaging.SendEmailResult>The list of standard Send Email Result (Messaging.SendEmailResult) records to be logged. These contain the delivery statuses of the emails that were sent (i.e., whether or not an email was sent successfully).

logNotifications(notifications, errorMessage)

global void logNotifications(List\<SE_SalesforceNotification\> notifications, String errorMessage)

DescriptionThis method logs the Salesforce notifications that were sent out as well as any corresponding error messages.
Returnsvoid
ParameterTypeDescription
notificationsList<SE_SalesforceNotification>The list of Salesforce Notification (SE_SalesforceNotification) instances to log.
errorMessageStringThe error that was thrown when the Salesforce notification was sent, if any.

Salesforce Notification

The Salesforce Notification (SE_SalesforceNotification) Apex class represents Salesforce notifications for custom system events.

global with sharing class SE_SalesforceNotification extends SE_Message

Accessor(s)

global Id customNotificationTypeId

Constructor

global SE_SalesforceNotification (Id recipientId,
Id primaryRecordId,
String body,
String subject,
Id customNotificationTypeId)
DescriptionA constructor to create a Salesforce notification for a custom system event.
ParameterTypeDescription
recipientIdIdThe ID of the User record that represents the recipient of the notification.
primaryRecordIdIdThe ID of the target record of the notification.
bodyStringThe body of the notification.
subjectStringThe subject of the notification.
customNotificationTypeIdIdThe ID of the notification for the custom system event.

Dynamic Trigger Handler

The Dynamic Trigger Handler (TAF_DynamicTriggerHdlr) Apex class exposes the methods for configuring the Trigger Action Framework.

global inherited sharing class TAF_DynamicTriggerHdlr

Constructor

TAF_DynamicTriggerHdlr()

global TAF_DynamicTriggerHdlr()

DescriptionAn empty constructor that allows the run(key) method to be called.

Method(s)

addMetadataTriggerHandlerBypass(triggerActionName)

global static void addMetadataTriggerHandlerBypass(String triggerActionName)

DescriptionThis method bypasses a specific trigger action during a transaction.
Returnsvoid
ParameterTypeDescription
triggerActionNameStringThe API name of the Trigger Action (mvn__TAF_Trigger_Action__mdt) metadata record to bypass.

addTriggerActionFlowBypass(flowName)

global static void addTriggerActionFlowBypass(String flowName)

DescriptionThis method bypasses a specific flow during a transaction.
Returnsvoid
ParameterTypeDescription
flowNameStringThe API name of the flow to bypass.

addTriggerBaseBypass(sObjectName)

global static void addTriggerBaseBypass(String sObjectName)

DescriptionThis method bypasses the trigger execution of a given sObject.
Returnsvoid
ParameterTypeDescription
sObjectNameStringThe API name of the sObject to bypass the trigger on.

clearMetadataTriggerHandlerBypass(triggerActionName)

global static void clearMetadataTriggerHandlerBypass(String triggerActionName)

DescriptionThis method clears the bypass flag for a specific trigger action.
Returnsvoid
ParameterTypeDescription
triggerActionNameStringThe API name of the Trigger Action (mvn__TAF_Trigger_Action__mdt) metadata record to no longer bypass and to execute instead.

clearTriggerActionFlowBypass(flowName)

global static void clearTriggerActionFlowBypass(String flowName)

DescriptionThis method clears the bypass flag for a specific flow.
Returnsvoid
ParameterTypeDescription
flowNameStringThe API name of the flow to no longer bypass and to execute instead.

clearTriggerBaseBypass(sObjectName)

global static void clearTriggerBaseBypass(String sObjectName)

DescriptionThis method clears the bypass flag for a given sObject.
Returnsvoid
ParameterTypeDescription
sObjectNameStringThe API name of the sObject to no longer bypass and to execute the trigger on instead.

getIdToNumberOfTimesSeenAfterUpdate()

global static Map\<Id, Integer\> getIdToNumberOfTimesSeenAfterUpdate()

DescriptionThis method returns a map of the context record IDs to the number of times they've been operated on in the AFTER UPDATE context. You can use this method to check the number of times the trigger has processed the records and therefore if the trigger is running recursively but cannot use this method to stop a recursion.
ReturnsMap<Id, Integer>

getIdToNumberOfTimesSeenBeforeUpdate()

global static Map\<Id, Integer\> getIdToNumberOfTimesSeenBeforeUpdate()

DescriptionThis method returns a map of the context record IDs to the number of times they've been operated on in the BEFORE UPDATE context. You can use this method to check the number of times the trigger has processed the records and therefore if the trigger is running recursively but cannot use this method to stop a recursion.
ReturnsMap<Id, Integer>

run(key)

global void run(String key)

DescriptionThis method is called from the trigger and initiates a new run.
Returnsvoid
ParameterTypeDescription
keyStringThe name of the trigger handler.

Trigger Action Interfaces

The Trigger Action (TAF_TriggerAction) Apex class collects the available interfaces when implementing a trigger for the Trigger Action Framework.

global class TAF_TriggerAction

Interface(s)

BeforeInsert

implements mvn.TAF_TriggerAction.BeforeInsert {
void beforeInsert(List<SObject> newList);
}
DescriptionThis interface allows the class to be used in a Before Insert context.
Returnsvoid
ParameterTypeDescription
newListList<SObject>The records from Trigger.new

AfterInsert

implements mvn.TAF_TriggerAction.AfterInsert {
void afterInsert(List<SObject> newList);
}
DescriptionThis interface allows the class to be used in an After Insert context.
Returnsvoid
ParameterTypeDescription
newListList<SObject>The records from Trigger.new

BeforeUpdate

implements mvn.TAF_TriggerAction.BeforeUpdate {
void beforeUpdate(List<SObject> newList, List<SObject> oldList);
}
DescriptionThis interface allows the class to be used in a Before Update context.
Returnsvoid
ParameterTypeDescription
newListList<SObject>The records from Trigger.new
oldListList<SObject>The records from Trigger.old

AfterUpdate

implements mvn.TAF_TriggerAction.AfterUpdate {
void afterUpdate(List<SObject> newList, List<SObject> oldList);
}
DescriptionThis interface allows the class to be used in an After Update context.
Returnsvoid
ParameterTypeDescription
newListList<SObject>The records from Trigger.new
oldListList<SObject>The records from Trigger.old

BeforeDelete

implements mvn.TAF_TriggerAction.BeforeDelete {
void beforeDelete(List<SObject> oldList);
}
DescriptionThis interface allows the class to be used in a Before Delete context.
Returnsvoid
ParameterTypeDescription
oldListList<SObject>The records from Trigger.old

AfterDelete

implements mvn.TAF_TriggerAction.AfterDelete {
void afterDelete(List<SObject> oldList);
}
DescriptionThis interface allows the class to be used in an After Delete context.
Returnsvoid
ParameterTypeDescription
oldListList<SObject>The records from Trigger.old

AfterUndelete

implements mvn.TAF_TriggerAction.AfterUndelete {
void afterUndelete(List<SObject> newList);
}
DescriptionThis interface allows the class to be used in an After Undelete context.
Returnsvoid
ParameterTypeDescription
newListList<SObject>The records from Trigger.new