Skip to main content

Apex classes

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

The Notification Log Service (SE_NotificationLogService) Apex class creates Notification Log (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 the 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)

Description

This method logs the emails that were sent out and their delivery statuses.

Returns

void

Parameter

Type

Description

emails

List<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.

results

List<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)

Description

This method logs the Salesforce notifications that were sent out as well as any corresponding error messages.

Returns

void

Parameter

Type

Description

notifications

List<SE_SalesforceNotification>

The list of Salesforce Notification (SE_SalesforceNotification) instances to log.

errorMessage

String

The error that was thrown when the Salesforce notification was sent, if any.

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 { get; set; }

Constructor

global SE_SalesforceNotification(
    Id recipientId,
    Id primaryRecordId,
    String body,
    String subject,
    Id customNotificationTypeId
)

Description

A constructor to create a Salesforce notification for a custom system event.

Parameter

Type

Description

recipientId

Id

The ID of the User record that represents the recipient of the notification.

primaryRecordId

Id

The ID of the target record of the notification.

body

String

The body of the notification.

subject

String

The subject of the notification.

customNotificationTypeId

Id

The ID of the notification for the custom system event.

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()

Description

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

Method(s)

addMetadataTriggerHandlerBypass(triggerActionName)

global static void addMetadataTriggerHandlerBypass(String triggerActionName)

Description

This method bypasses a specific trigger action during a transaction.

Returns

void

Parameter

Type

Description

triggerActionName

String

The API name of the Trigger Action (mvn__TAF_Trigger_Action__mdt) metadata record to bypass.

addTriggerActionFlowBypass(flowName)

global static void addTriggerActionFlowBypass(String flowName)

Description

This method bypasses a specific flow during a transaction.

Returns

void

Parameter

Type

Description

flowName

String

The API name of the flow to bypass.

addTriggerBaseBypass(sObjectName)

global static void addTriggerBaseBypass(String sObjectName)

Description

This method bypasses the trigger execution of a given sObject.

Returns

void

Parameter

Type

Description

sObjectName

String

The API name of the sObject to bypass the trigger on.

clearMetadataTriggerHandlerBypass(triggerActionName)

global static void clearMetadataTriggerHandlerBypass(String triggerActionName)

Description

This method clears the bypass flag for a specific trigger action.

Returns

void

Parameter

Type

Description

triggerActionName

String

The 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)

Description

This method clears the bypass flag for a specific flow.

Returns

void

Parameter

Type

Description

flowName

String

The API name of the flow to no longer bypass and to execute instead.

clearTriggerBaseBypass(sObjectName)

global static void clearTriggerBaseBypass(String sObjectName)

Description

This method clears the bypass flag for a given sObject.

Returns

void

Parameter

Type

Description

sObjectName

String

The API name of the sObject to no longer bypass and to execute the trigger on instead.

getIdToNumberOfTimesSeenAfterUpdate()

global static Map<Id, Integer> getIdToNumberOfTimesSeenAfterUpdate()

Description

This 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.

Returns

Map<Id, Integer>

getIdToNumberOfTimesSeenBeforeUpdate()

global static Map<Id, Integer> getIdToNumberOfTimesSeenBeforeUpdate()

Description

This 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.

Returns

Map<Id, Integer>

run(key)

global void run(String key)

Description

This method is called from the trigger and initiates a new run.

Returns

void

Parameter

Type

Description

key

String

The name of the trigger handler.

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);
}

Description

This interface allows the class to be used in a Before Insert context.

Returns

void

Parameter

Type

Description

newList

List<SObject>

The records from Trigger.new

AfterInsert

implements mvn.TAF_TriggerAction.AfterInsert {
    void afterInsert(List<SObject> newList);
}

Description

This interface allows the class to be used in an After Insert context.

Returns

void

Parameter

Type

Description

newList

List<SObject>

The records from Trigger.new

BeforeUpdate

implements mvn.TAF_TriggerAction.BeforeUpdate {
    void beforeUpdate(List<SObject> newList, List<SObject> oldList);
}

Description

This interface allows the class to be used in a Before Update context.

Returns

void

Parameter

Type

Description

newList

List<SObject>

The records from Trigger.new

oldList

List<SObject>

The records from Trigger.old

AfterUpdate

implements mvn.TAF_TriggerAction.AfterUpdate {
    void afterUpdate(List<SObject> newList, List<SObject> oldList);
}

Description

This interface allows the class to be used in an After Update context.

Returns

void

Parameter

Type

Description

newList

List<SObject>

The records from Trigger.new

oldList

List<SObject>

The records from Trigger.old

BeforeDelete

implements mvn.TAF_TriggerAction.BeforeDelete {
    void beforeDelete(List<SObject> oldList);
}

Description

This interface allows the class to be used in a Before Delete context.

Returns

void

Parameter

Type

Description

oldList

List<SObject>

The records from Trigger.old

AfterDelete

implements mvn.TAF_TriggerAction.AfterDelete {
    void afterDelete(List<SObject> oldList);
}

Description

This interface allows the class to be used in an After Delete context.

Returns

void

Parameter

Type

Description

oldList

List<SObject>

The records from Trigger.old

AfterUndelete

implements mvn.TAF_TriggerAction.AfterUndelete {
    void afterUndelete(List<SObject> newList);
}

Description

This interface allows the class to be used in an After Undelete context.

Returns

void

Parameter

Type

Description

newList

List<SObject>

The records from Trigger.new