InformationTitleLeanData - Technical OverviewURL NameLeanDataTechnicalOverview6902023edebbbStep-by-StepContents: OverviewLeanData Managed Application Custom Objects FootprintManaged Application Fields on Standard Salesforce ObjectsLeanData Apex JobsTriggers Overview The following guide contains a high level overview of the LeanData managed app. Various fields, triggers, and objects are utilized depending on products purchased and implemented. There are two separate LeanData Managed Applications: LeanData Matching and Routing - for LeanData Tagging, Routing, & BookIt products.LeanData Analytics - for LeanData Engagement The objects and fields that will be added into your Salesforce instance depends on which Managed Application you are installing. LeanData Managed Application Custom Objects Footprint When installing a LeanData Managed Application, LeanData will create its own custom objects as well as some fields on standard Salesforce objects. These objects and fields are used to maintain LeanData operation. LeanData Matching and Routing Managed Application Footprint 61 Custom Objects Fields by Object (Standard Objects) Lead : 9 Account : 4 Contact : 5 Opportunity : 2 Case : 2 LeanData Analytics Managed Application Footprint (Engagement Customers Only) 8 Custom Objects Fields by Object (Standard Objects) Activity (Tasks & Event) : 1 Campaign Member : 1 Managed Application Fields on Standard Salesforce Objects The following are the core managed application fields on your existing standard Salesforce objects. Any associated LeanData managed app fields not listed below may have been removed in prior versions of LeanData. Lead Object Fields Application Fields The following fields can be used for reporting or operational purposes. FieldPurposeAPI NameReporting Matched AccountMatched account reference field (only populated if a matched account exists)LeanData__Reporting_Matched_Account__cRouting ActionLead’s Router action: contains last associated Router action on a leadLeanData__Routing_Action__c Internal Fields The following fields are intended for core LeanData application usage. These fields should not be used (for either reporting or operational purposes) and are subject to deletion or change at any time. FieldPurposeAPI NameLeanData SearchOperational field used for match performance optimizationsLeanData__Search_Index__cModified ScoreUsed in conjunction with LeanData Account Scoring productLeanData__Modified_Score__cMatched Buyer PersonaUsed in conjunction with LeanData's Buyer Persona product (deprecated)LeanData__Matched_Buyer_Persona__cReporting TimestampOperational field used for LeanData MatchingLeanData__Reporting_Timestamp__cLeanData Routing StatusLead’s status for Lead-to-Account routingLeanData__Routing_Status__cSegmentUsed for debugging purposesLeanData__LD_Segment__cState infoOperational field used to track how a lead’s state across various LeanData productsLeanData__Status_Info__c Contact Object Fields Application Fields The following fields can be used for reporting or operational purposes. FieldPurposeAPI NameRouting ActionContact’s Router action: contains last associated Router action on a contactLeanData__Routing_Action__c Internal Fields The following fields are intended for core LeanData application usage. These fields should not be used (for either reporting or operational purposes) and are subject to deletion or change at any time. FieldPurposeAPI NameModified ScoreUsed in conjunction with LeanData Account Scoring productLeanData__Modified_Score__cMatched Buyer PersonaUsed in conjunction with LeanData's Buyer Persona product (deprecated)LeanData__Matched_Buyer_Persona__cSegmentUsed for debugging purposesLeanData__LD_Segment__cStatus InfoStores a given state across various LD productsLeanData__Status_Info__c Account Object Fields Application Fields The following fields can be used for reporting or operational purposes. FieldPurposeAPI NameRouting ActionAccount Routing action: contains last associated Routing action on an accountLeanData__Routing_Action__c Internal Fields The following fields are intended for core LeanData application usage. These fields should not be used (for either reporting or operational purposes) and are subject to deletion or change at any time. FieldPurposeAPI NameLD Email DomainsEmail domains for Contacts under this account (used for matching)LeanData__LD_EmailDomains__cLeanData SearchOperational field used for match performance optimizationsLeanData__Search__cStatus InfoStores a given state across various LD productsLeanData__Status_Info__c Opportunity Object Fields Application Fields The following fields can be used for reporting or operational purposes. FieldPurposeAPI NameRouting ActionContains the last associated Routing action on an OpportunityLeanData__Routing_Action__c Internal Fields The following fields are intended for core LeanData application usage. These fields should not be used (for either reporting or operational purposes) and are subject to deletion or change at any time. FieldPurposeAPI NameStatus InfoStores a given state across various LD productsLeanData__Status_Info__c Case Object Fields Application Fields The following fields can be used for reporting or operational purposes. FieldPurposeAPI NameRouting ActionContains last associated Routing action on a Case.LeanData__Routing_Action__c Internal Fields The following fields are intended for core LeanData application usage. These fields should not be used (for either reporting or operational purposes) and are subject to deletion or change at any time. FieldPurposeAPI NameStatus InfoStores a given state across various LD productsLeanData__Status_Info__c Activity (Task & Event) Object Fields (Analytics Managed App only) Application Fields The following fields can be used for reporting or operational purposes. These fields are only applicable for customers who are subscribed to LeanData Engagement. FieldPurposeAPI NameLD EngagementUsed for Engagement: Displays Engagement associated with activityLD_Engagement__c Campaign Member Object Fields (Analytics Managed App only) Application Fields The following fields can be used for reporting or operational purposes. These fields are only applicable for customers who are subscribed to LeanData Engagement and have downloaded the LeanData Analytics Managed Package. FieldPurposeAPI NameLD EngagementUsed for Engagement: Links the Campaign Member to the Sales or Marketing Engagement LD_Engagement__c LeanData Apex Jobs Below is an overview of the primary Apex jobs that may run as part of your LeanData installation. Note some batches and scheduled jobs are specific to products and processes that are enabled and that some implementations may only run a portion of the batches below. CCIOMigrationBatch Batch that runs when a new graph is deployed to migrate existing CCIOs to the new deployment. CheckOnDemandAllowed Scheduled job that runs hourly. On execution, it calls a @future method (futureCheckOnDemandAllowed) that makes a web callout to LeanData servers to sync with settings and check on licensing (API Endpoint: leandata.my.salesforce-sites.com). The web callout made by CheckOnDemandAllowed is a very lightweight call, meaning the impact to system resources is negligible. LeadConverter Job that runs whenever Router requires that a Lead be converted. This job will run after the corresponding LeanDataContinuousBatch and the job will abort after it finishes processing the conversions. LeanDataContinuousBatch Apex Batch job that queries against the CC_Inserted_Object__c custom objects to find the inserts and updates waiting in queue to be processed for matching and routing. LeanData CC Scheduler is the Scheduled Job that fires off the batch. After LeanDataContinuousBatch finishes executing, a new instance of LeanData CC Scheduler gets scheduled for future processing. This is the loop that performs all of the matching and routing. Batch Apex jobs are limited to five at a time inside of an SFDC org. This limit and the allocation of jobs is controlled by the Salesforce Flex Queue system. At any given time in the system, only one LeanDataContinuousBatch job will be running (when a job slot is allocated by Salesforce), and that is only when we are actively routing Leads. This means that the resource impact on governor limits is minimal. Both of these jobs should always be scheduled by the desired LeanData integration user, so that any routing will show as having been performed by that user. OneTimeRoutingBatch This is the job that executes any Scheduled or recurring routing Jobs via LeanData's Routing Scheduler tool. The running user will be whichever user initiated the job unless a setting is enabled to utilize the LeanData Integration User. PartnerCalloutBatch Job that initiates when LeanData makes a callout to an external system for one of LeanData's partner integrations (API Endpoint: app.leandata.com). Some Partner Callouts may be sent directly to a partners API endpoint. PartnerUtility Job that fetches metadata from an external system for use with one of LeanData's partner integrations. PopulateAccountEmailDomainBatch Batch job that runs on initial installation as well as periodically while LeanData application is actively running. This job is used for search data optimizations and indexing to allow LeanData search to run more effectively within Salesforce (for Accounts). PopulateLeadSearchFieldBatch Batch job that runs on initial installation as well as periodically while LeanData application is actively running. This job is used for search data optimizations and indexing to allow LeanData search to run more effectively within Salesforce (for Leads). RemoteLogger Job that runs following the LeanData Continuous Batch job to create audit logs for processed records. RoutingLogCleanBatch Batch Job that runs regularly to delete Logs older than 90 days from the current date. The time frame can be adjusted by a LeanData representative. SchedulingMonitor Because LeanDataContinuousBatch and Scheduler are critical to routing of leads on the system and the loop could be interrupted for a number of reasons like user error, unexpected/uncatchable exceptions, or system updates, it is important to have redundancy to ensure that routing continues. SchedulingMonitor is a scheduled job that runs every hour to make sure that the LeanDataContinuousBatch / Scheduler loop is still running. As with LeanDataContinuousBatch, this job should only be run as the LeanData user. UpdateLeadForMappedFieldsBatch Runs as needed on-demand as a Queueable job if there are account updates that require leads to be run through lead-to-account matching. Please Note: LeanData will automatically reserve processing and flex queue slots to lock key jobs such as continuous batch and partner callouts, ensuring that these essential processes run on time, preventing bottlenecks and maintaining the performance of critical operations. LeanData Analytics Managed App (Engagement Customers Only) Eng_ProcessingBatch: Creates / Deletes Engagements Eng_MetricsBatch: Creates / Updates Account Metrics Objects Please note: To ensure consistent and timely processing, LeanData reserves one of your organization’s 100 scheduled Apex job slots exclusively for LeanData routing, preventing routing delays that could otherwise occur when a high volume of other jobs are running in your Salesforce org. Triggers LeanData has implemented the following Triggers within the managed package (LeanData namespace). These Triggers are critical to ensure the LeanData managed app is running properly. Account Triggers ContinuousCleanAccountTrigger (before insert, after insert) Before/after Account insert; performs pre-insert cleanup and post-insert processing.Set Search FieldSet Routing Action for Accounts created from Lead Routing ConversionCreates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Routing and Tagging when applicable. ContinuousCleanAccountUpdateTrigger (before update, after update) Before/after Account update; executes pre/post update logic and triggers Journey Management account updates.Set Search Field and Email DomainsCreates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Routing, Tagging, and Update Mapped Lead Fields when applicable. AccountDeleteTrigger (before delete) Creates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Tagging.Runs before Account delete; reprocesses previously tagged Leads and performs hierarchical cleanup via the handler. Campaign Triggers LeanDataCampaignTrigger (after update) After Campaign update; forwards to Journey Management to process campaign changes. Campaign Member Triggers ContinuousCleanCampaignMemberTrigger (after insert, after update, before delete) After insert/update and before delete of CampaignMember; processes member changes and updates Journey Management and including cleanup on delete. Contact Triggers ContinuousCleanContactTrigger (after insert, after delete) After insert and before update and before delete of Contact; handles lifecycle operations and triggers Journey Management on insert.Creates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Routing, and Populate Account Email Domain Batch. ContinuousCleanContactUpdateTrigger (after update) After Contact update; runs update processing and Journey Management contact update.Creates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Routing, and Populate Account Email Domain Batch. ContactBeforeInsertTrigger (before insert) Before Contact insert; runs pre-insert processing (e.g.and validation/dedupe) via the handler.If Contact is created from LeanData Lead Conversion we set Routing Action and map Lead Fields to Contact Event Triggers ContinuousCleanEventTrigger (after insert, after update, before delete) After insert/update and before delete of Event; logs activity inserts and updates Journey Management and and handles related cleanup on delete. Lead Triggers ContinuousCleanLeadTrigger (after insert) After Lead insert; runs post-insert lead processing and Journey Management lead insert. ContinuousCleanLeadUpdateTrigger (after update) After Lead update; runs update logic (unless routed to before-update by setting) and Journey Management lead update. BeforeLeadInsert (before insert) Before Lead insert; delegates to lead pre-insert handler for validation/normalization when Lead triggers are enabled.Sets Search Field(for Matching)Syncs Reporting_Matched_Account__c’s fields to the Lead object if this lookup is manually set on insert BeforeLeadUpdate (before update) Before Lead update; runs pre-update logic andand if a setting is enabledand executes full lead update processing in the before context.Updates Search Field if applicable(for Matching)Syncs Reporting_Matched_Account__c’s fields to the Lead object if this lookup is manually set on updateCreates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Routing, and Tagging. Opportunity Triggers ContinuousCleanOpportunityTrigger (after insert) Before/after Opportunity insert; invokes post-insert processing for opportunities (pre-insert path set but not used here).Creates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Routing when applicable. ContinuousCleanOpportunityUpdateTrigger (before update) After Opportunity update; runs update logic and Buying Group Journey update.Creates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Routing when applicable. Opportunity Contact Role Triggers LeanDataOpportunityContactRoleTrigger (after insert, after update, before delete) After insert/update and before delete of OpportunityContactRole; triggers Buying Group-specific role handlers for add/change/remove. Case Triggers ContinuousCleanCaseTrigger (after insert) Before/after insert and after update of Case; processes case creation and updates via the handler.Creates LeanData’s Token object(LeanData__CC_Inserted_Object__c) for Routing when applicable. Task Triggers ContinuousCleanTaskTrigger (after insert, after update) After insert/update and before delete of Task; logs activity creation and updates Journey Management and with cleanup on delete. User Triggers addLeanDataPermissionSet (after insert, after update) After insert/update of User; on insert assigns permission sets by profile if missing and on update reassigns on profile change and revokes BookIt tokens for deactivated users and and syncs user info when relevant fields change. Other Triggers / LeanData Operational Triggers LeanDataJourneyTrigger After insert/update of LD_Journey__c; forwards to Buying Group Journey update handler. LeanDataJourneyMemberTrigger After insert/update of LD_Journey_Member__c; filters out invalid records and processes member updates and and optionally writes CCIO insert/update via the handler. BatchApexErrorEventTrigger On BatchApexError Event insert and auto-tunes LeanData batch sizes when limit exceptions occur and records recent error history to back off safely. BeforeRoutingDeploymentDeleteTrigger LDDatasetTrigger Before delete of Routing_Deployment__c; delegates to custom handler for cleanup.On LD_Dataset__c insert/update/delete; delegates to dataset before/after handlers (after upsert and before update). LDDatasetVersionTrigger On LD_Dataset_Version__c insert/update/delete; delegates to version-specific before/after handlers. LDMemberTrigger After insert/update/delete of LD_Member__c; collects old/new snapshots and writes history logs for member edits. PoolManagersBUAdminsInsertTrigger Before insert of Access_level_Assignment__c; validates pool manager/BU admin assignment creation. RoundRobinPoolManagerTrigger Before/after insert/delete of Access_Level_Assignment__c; validates member/manager assignments and writes before/after history logs for affected pools. RoundRobinPoolMembersInsertTrigger Before insert of Round_Robin_Setting__c; validates pool members before creation. RoundRobinPoolTrigger Full lifecycle on Round_Robin_Pool__c; validates on beforeand and writes before/after history logs for pool changes. RoundRobinPoolsInsertTrigger Before insert of Round_Robin_Pool__c; validates pool creation via custom handler. RoundRobinScheduleTrigger After insert/update and before delete of Round_Robin_Schedule_Setting__c; logs working hours/vacation/holiday changes and capping ruleset updates. RoundRobinSettingTrigger All events on Round_Robin_Setting__c; validates beforeand logs before/after data for poolsand and handles capping config history changes.