Skip to main content
Full Circle Insights

Extensibility Events Reference

This section includes detailed information on each supported extensibility event.

The API name for available events are defined as constants in class FCR_ExtensibilityAPI. Event names are case sensitive.

Active Response Processed


API Name: ActiveResponseProcessed

Description:Called after completion of the entire evaluation-assignment-notification sequence for an active response to a lead or contact.

Properties:

getRecordIDsContains one entry – a list of IDs of the leads or contacts for which an active response was processed. Note that this list can contain an arbitrary list of lead and contact IDs – it is your responsibility to separate them if necessary.

Typical use:Use this function to perform custom processing on leads, contacts and their responses. This function is called after all response processing has completed – this includes assignment and notification.

Notes:

This function may be called in a future, batch or non-future context.

This function is not synchronous during response prompt processing.

By the time this function is called, the original response may no longer be active – it is your responsibility to determine if there is still an active response on the lead or contact.This function is also called for inactive responses that result in an assignment after the assignment is complete.

In rare situations with bulk processing and large numbers of sync fields, field synchronization from the lead/contact to the response may not be complete at the time this function is called.
In rare situations where an update is deferred due to a DML lock, the lead/contact or response may not be updated before this function is called. If this is an issue in your org, you can query the FCR_DeferredUpdateItem__c object to determine if this applies to any of the objects in question.

Inactive Response Processed

API Name: InactiveTQResponseProcessed

Description:Called after completion of the evaluation sequence for a qualified response to a lead or contact that is inactive.

Properties:

getRecordIDsContains one entry – a list of IDs of the leads or contacts for which an inactive response was processed. Note that this list can contain an arbitrary list of lead and contact IDs – it is your responsibility to separate them if necessary.

Typical use:Use this function to perform custom processing on leads, contacts and their responses. This function is called after response evaluation has completed – this does not include assignment and notification.

Notes:

This function may be called in a future, batch or non-future context.You can refer to the FCR_PostAssignNotificationPending__c field on the lead or contact to determine if assignment is pending for the lead or contact. If so, the Active Response Processed event will be raised for this lead after assignment is complete. The logic here differs somewhat from the Active Response Processed event, that is not called on active responses if assignment is pending.

By the time this function is called, the original response may no longer be inactive – it is your responsibility to determine if there is still an active response on the lead or contact.

In rare situations where an update is deferred due to a DML lock, the lead/contact or response may not be updated before this function is called. If this is an issue in your org, you can query the FCR_DeferredUpdateItem__c object to determine if this applies to any of the objects in question.

Inactive Unqualified Response Processed


API Name: InactiveNonTQResponseProcessed

Description:Called after completion of the evaluation sequence for a non-qualified response to a lead or contact that is inactive.

Properties:

getRecordIDsContains one entry – a list of IDs of the leads or contacts for which an inactive response was processed. Note that this list can contain an arbitrary list of lead and contact IDs – it is your responsibility to separate them if necessary.

Typical use:Use this function to perform custom processing on leads, contacts and their responses. This function is called after response evaluation has completed – this does not include assignment and notification.

Notes:

This function may be called in a future, batch or non-future context.You can refer to the FCR_PostAssignNotificationPending__c field on the lead or contact to determine if assignment is pending for the lead or contact. If so, the Active Response Processed event will be raised for this lead after assignment is complete. The logic here differs somewhat from the Active Response Processed event, that is not called on active responses if assignment is pending.

In rare situations where an update is deferred due to a DML lock, the lead/contact or response may not be updated before this function is called. If this is an issue in your org, you can query the FCR_DeferredUpdateItem__c object to determine if this applies to any of the objects in question.

Leads Converted

API Name: LeadsConverted

Description:Called after completion lead conversion processing.

Properties:

getRecordIDsContains one entry – a list of IDs of the converted leads. 
getRecordListsContains three entries:

    • The list of converted contacts (objects)
    • A list containing the active response (after conversion) on the converted contact. Entries may be null.
    • A list containing the created opportunity for each conversion. Entries may be null.

getAdditionalParams contains a list of FCR_ExtensibilityAPI.ConversionHookItem objects, one for each converted lead. Each object has the following fields:

    • ContactID - The converted contact ID
    • LeadID - The lead ID
    • OpportunityID - The opportunity ID (may be null)
    • ConvertedLeadStatus - The conversion status of the lead (status after conversion)
    • PriorLeadStatus - The status of the lead prior to conversion
    • LeadIsPassive - Boolean value is true if this lead was passive at the time of conversion (converted by passive user, passive mode org, or passive record type)

Typical use:Use this function to perform custom processing after conversion.

Notes:

This function may be called in a future, batch or non-future context.All four lists have the same size, where each entry represents a conversion operation.This function is called after the response management system has completed conversion processing, but before the opportunities, contacts and responses are updated – you may modify fields during this call.You may perform a SOQL call to retrieve information about converted leads, but may not update those leads.You must not perform a DML operation on any of these objects.Because of merges, it is possible for multiple leads to convert into the same contact.

Keep in mind that operation may be asynchronous, and processing may occur well after the conversion operation has completed.

The getAdditionalParams parameter was added in version 1.18 of the application. Existing integrations may need to be configured to reference the latest version of the application to see this parameter.

Merge Complete


API Name: MERGECOMPLETE

Description:Called after lead or contact merge processing.

Properties:

getRecordIDsContains one entry – a list of IDs of the master (surviving) leads and contacts.

Typical use:Use this function to perform custom processing after merge.

Notes:

This function may be called in a future, batch or non-future context.This function is called after the response management system has completed merge processing. You may query for the merged leads or contacts by using the All Rows term and filtering on the MasterRecordID field.This function is called for leads or contacts – all IDs in the list will be of the same type.On Person Account orgs, this function is called on backing contacts – not the accounts themselves.

Notification Request

API Name: NotificationRequest

Description:Called before sending Email notifications. This function is called once for each Email message (both to a user and their delegate), and again after all notifications have been processed but before emails are sent.This function can block individual Emails from being sent.

Properties:

getRecordLists:Contains one entry – list to a single CampaignMember for which notifications are being sent. This CampaignMember contains all fields that are available during notifications. This includes both Full Circle CampaignMember fields, most standard fields and sync fields.Do NOT modify any fields in this object. Will be null if processingComplete is true on the additional parameters.

getAdditionalParams:Contains a single FCR_ExtensibilityAPI. NotificationHookItem object. This object has the following fields:

    • leadOrContactId – The ID of the lead or contact. You can use the Use the ID.getSObjectType() method to determine the object type. Will be null if processingComplete is true.
    • isActiveResponseTemplate – True if this Email is in response to a new active response (uses the active response template)
    • isAlreadyEngagedTemplate – True if this email is an already engaged notification (uses the already engaged template)
    • isPrecedenceCampaignTemplate – True if this email is a precedence campaign notificaiton (uses the precedence campaign template)
    • isDelegate – True if this Email is going to a delegate user
    • Messaging.Singleemailmessage message – A singleEmailMessage object that is ready to send. All fields in the object are set. Will be null if processingComplete is true. You may modify fields in this object.
    • blockEmail - Initially false, set this field to true to prevent the Email from being sent by the Response Management application. Not applicable if processingComplete is true.
    • processingComplete – This field will be true on the final call to the plugin for a series of notifications. All other fields will be null or invalid if this field is true.

Typical Use: This function is called for each Email after it is created. There are two typical uses for the function:

  • Decide which Emails to block or to send using the plugin. This function will be called multiple times, once for each Email. Once all of the Emails have been processed, the function will be called one last time with the processingComplete field set to true. At this time, you can perform any final operation based on data collected in the previous calls – for example, to send out one or more Email notifications in your code.
  • Modify Emails before sending – changes made to the SingleEmailMessage will apply when the application sends the Email.


Notes:

This function can be called in a trigger, future or batch context.

Do not modify the CampaignMember object provided by this function. The field values in the CampaignMember object may not reflect the values in the database if this function is called during a trigger.

More than one set of notifications can go out within an execution context.

Post Sequence Trigger

API Name: PostSequence 
Description:Called during every trigger after completion of all Response Management processing. Triggers that occur during Response Management processing do not raise this event (in other words, triggers that result from internal DML operations).This is the preferred way to process Lead, Contact, CampaignMember, Account and Opportunity triggers.Use the ID.getSObjectType() method to determine the object type. 
Properties:

  • getRecordLists:Contains two entries. The first is a reference to trigger.new, the second is a reference to trigger.old.
  • getRecordMaps:Contains two entries. The first is a reference to trigger.newMap, the second is a reference to trigger.OldMap
  • getAdditionalParams:Contains the following entries in order:

0 - String: The object name (Lead, Contact, Opportunity, etc.)
1 - Boolean: isExecuting
2 - Boolean: isInsert
3 - Boolean: isUpdate
4 - Boolean: isDelete
5 - Boolean: isBefore
6 - Boolean: isUndelete


Typical Use:A preferred way to implement triggers if you wish to ensure processing after the response management application.

Notes:

Entries in getRecordLists and getRecordMaps may be null (depending on trigger type).

You must follow all of the standard rules for each trigger type with regards to referencing the context variables.

Field values in after triggers may not reflect the current field values in the database – it is possible that DML operations during response management application processing updated field values using clones of the objects.

The RequestedFields plugin method has no impact with this event.

Prescoring

API Name: Prescoring
Description:Called before scoring operations to allow custom code to calculate the lead or contact score when the calculations are too complex to handle using formula fields.

Properties:

  • getRecordLists:Contains two entries. The first is a list of either leads or contacts to process. The second is a list of the related CampaignMember objects (this second list may be empty during reactivation)
  • getRecordMaps:Contains one entry - A map to the related campaigns for the CampaignMember objects. Note that this map will be null during reactivation.
  • getAdditionalParams:Contains the following entries in order:

0 - String: A string defining the type of scoring operation. It will either be "scoring" or "reactivation"

Typical Use: During the event, it's common to populate a lead, contact or campaignmember field with a calculated score. The field should be the one defined for scoring in configuration. The field can be different for regular and reactivation scoring.

Notes:

Be sure to use the RequestedFields plugin method to define all fields required to perform the necessary calculations. The default (configured) scoring fields will be queried automatically.

Keep in mind that the objects used to determine the score varies based on the type of scoring being done. For example: regular scoring always references the lead/contact, CampaignMember and campaign score fields, whereas scoring reactivation typically only refers to the lead/contact and sometimes CampaignMember score fields.

When called during reactivation, this event will be called once for each object (i.e., the getRecordLists parameter object lists will contain one record). You should not perform any queries during this call and should optimize for performance as much as possible.

This event may be called in a synchronous or asynchronous context.

Be aware that the Campaign objects provided in the getRecordMaps parameter refer to the campaigns form the CampaignMember objects (i.e. the campaignId field on the CampaignMember corresponds to keys in this map). However, in the event that these are repeat campaigns, the score field will not be valid. Instead, you must reference the score field via the FCRM.FCR_CascadeParent__r object. For example, if the score field is score, use FCRM.FCR_CascadeParent__r.score to view the campaign score.

The scoring field that you populate will be saved during regular scoring, however whether it is saved during scoring reactivation is indeterminate. In particular, it is not saved when evaluating whether rescoring reactivation should occur, and will otherwise only be saved in cases where the evaluation is made during the same context as the lead, contact or campaignmember is being updated anyway. So you should NOT treat the scoring field as a reliable indicator of the current score, as you would a formula field. If you require a reliable complex scoring field, you should use Response Management asynchronous scoring and your own custom code.

Available on Release 1.21.33 and later

Response Preprocessing

API Name: ResponsePreprocessing

Description:Called after response detection and cascade (repeat response) evaluation, but before newly created repeat campaignmembers are saved and before they are passed on to scoring.

Properties:

getRecordListsContains three entries:

    • Entry 0: TimedOutResponses – A list of CampaignMembers that are not being treated as responses due to repeat response timeouts. If the ID field is null, these are newly inserted responses, otherwise they are updates.
    • Entry 1: NonCascadeResponses – A list of CampaignMembers that are not being treated as responses due to other reasons (not allowed on the campaign, number of repeats exceeded, update that is not an automation user or from our VisualForce controller)
    • Entry 2: InsertedCmResponsesToProcess – A list of CampaignMembers that are being treated as responses during an insert operation. These may be completely new responses. They may also be repeats where the CampaignID has been changed to the repeat campaign

getRecordMapsContains three entries:

    • Entry 0: UpdatedCmResponsesToProcess – A map of IDs to CampaignMembers that are being treated as responses during an update operation. The ID key represents the ID of the originating CampaignMember – the one being updated. The CampaignMember may be the originating CampaignMember (in the case that the CampaignMember is being changed from non-responded to responded), or it may be a newly created repeat CampaignMember that is a repeat of the originating response.
    • Entry 1: ExistingMap – On update, this is a map of CampaignMember ID to CampaignMember containing the "new" values during the update trigger. During an update, every CampaignMember in the other lists or maps will have an entry in this map.
    • Entry 2: OldMap – On update, this is amap of CampaignMember ID to CampaignMember containing the "old" values during the update trigger. During an update, every CampaignMember in the other lists or maps will have an entry in this map.

Typical Use:Use this function to initialize CampaignMember fields during response processing. For inserted responses, you can use this hook to initialize field values on CampaignMembers based in part on how they are being processed. For updated responses, you can use this hook to copy field values from originating responses to repeat responses, to reset field values on originating responses to their original (old) values, or both.

Notes:

All of the CampaignMembers referenced by the list and map parameters can be modified directly – this hook is called during a before trigger and before insertion of new objects – no DML is required.

No DML operations should be performed during this hook

You may use SOQL queries during this function

At the time this hook is called, Cascade campaigns will already be created and their CampaignID values set into the repeat CampaignMember objects. 
 

Status or Owner change


API Name: StatusOrOwnerChange

Description:Called during the Before update trigger on a lead, contact or person account when a status or owner change is detected. Both changes may be present when this event is raised.

Properties:

getRecordListsContains two entries: Entry 0 is a list of the lead, contacts or person account objects that had either a status or owner change. All items in the list are of the same type.Entry 1 is a list of the active responses corresponding to the leads, contacts or person accounts. All processing on this response is complete by the time this function is called, and the responses may no longer be active in cases where the status of the controlling object has changed to an inactive status.

getRecordMapsContains one entry – the "oldmap" map for the trigger that caused this call.

Typical use:Use this function to perform your own status or owner update processing on a lead, contact or person account. This event is raised after the FCRM processing is complete. 
Notes:This event is called during a before-update trigger. All fields on each object are available and can be modified.
This event is called after the FCRM processing. Synchronization to the active response will already have been completed.
In rare situations with bulk processing and large numbers of sync fields, field synchronization from the lead/contact to the active response may not be complete at the time this function is called (you can detect this condition by seeing a non-zero value in the FCR_Admin_SyncPending__c on the active response for this object).

Scheduled (timed) asynchronous call

API Name: TimedAsync

Description:Called at approximately the time specified during a call to the FCR_SupportAPI.ScheduleAsyncOperation method.

Properties:

getXMLdataContains the parameter data specified by the original call to the FCR_SupportAPI.ScheduleAsyncOperation method. Despite the parameter name, this string need not contain XML content (i.e., you can use any format you wish)

Typical use:This functionality provides a simple mechanism to piggyback onto the Full Circle CRM scheduler to schedule any number of Apex operations using a single Scheduled Apex job.

Notes:

This event is called during a batch Apex operation. Standard Apex batch limits and restrictions apply.This functionality is only enabled when the new asynchronous system is enabled (advanced configuration).

Other extensibility events can be raised while this event is being processed (normally event reentrancy is not allowed).

Upsert Deferred


API Name: UpsertDeferred

Description:Called when an internal update fails and an FCR_ DeferredUpdateItem__c object is created . This is typically due to a DML lock or validation rule failure.

Properties:

getRecordListsContains a list of Sobjects that failed an upsert or update operation. This is typically because of a DML lock or a validation rule error.

Typical use:If you modify any object fields during a hook, this event indicates that one or more of the objects you may have modified may not have been saved correctly. The internal deferred object mechanism can track and recover fields modified by the application, but not fields that you modify.

If this event is called in the same execution context as a previous one, you will know that one or more of your updates may have failed. Consider logging or providing some notification with regards to the issue. This should occur rarely.

Note:

Do not modify incoming records – changes will not be saved.

Some update failures will not cause an internal deferred update object to be created - for example:attempting to update a converted lead or an object that has been deleted.

  • Was this article helpful?