Difference between revisions of "Salesforce:Custom Clean Suite Batch Processing"

From Melissa Data Wiki
Jump to navigation Jump to search
Line 1: Line 1:
[[Clean Suite for CRM:Salesforce|← Clean Suite for CRM:Salesforce]]
{{ListwareForSalesforceNav}}
 
{{CustomTOC}}
{{CustomTOC}}



Revision as of 19:40, 12 January 2022

← Clean Suite for CRM:Salesforce

Salesforce Navigation
Introduction
Getting Started
Installation
Getting Started with Lightning Components
Credits
Lightning Components
Lightning Quick Actions
Lightning Lookups
Lightning Global Express Entry
Clean Suite Advanced Mappings
Clean Suite Batch Processing
Result Code Status Indicator
Visualforce Pages
Installing Visualforce Pages
Custom Visualforce Pages
Custom Code
APEX Triggers
Custom Clean Suite Batch Processing
Express Entry Lightning Action Override
Result Codes
Salesforce Result Codes



Batch Processing

What is Batch Processing and how does it work?

Batch processing allows you to run multiple records at once against Melissa services. Administrators can select specific records for processing through a query as well. This flexibility allows Administrators the ability to schedule regular jobs for record processing as well.
Clean Suite Batch Jobs are tied to a specific object and specific [Clean Suite Advanced Mapping]. Meaning, you must specify the type of salesforce object (standard or custom) as well as the mapping you wish to use for that job. Note, the mapping specified must exist for the object or the job will fail.

How do I run a batch job?

  1. Select the class of Melissa Endpoints to use from the following list:
    • MD_PersonatorBatch (Personator Verification)
    • MD_GlobalBatch (Global Address Verification)
    • MD_GlobalEmailBatch (Global Email Verification)
    • MD_GlobalPhoneBatch (Global Phone Verification)
  2. Choose the object and mapping you want to use.
  3. In the screenshot below we created a Contact mapping named "Mailing Address Verification" for the Personator Verification Web service.
    Salesforce CSBatch 01 ContactMapping.png
  4. Craft the query
  5. In the example below we specified the Object Type from above and that we want only 10 records.
    SELECT ID FROM CONTACT LIMIT 10
  6. Craft the statement
  7. Now we need to put it all together! The following statement will execute a batch job using our query from above as well as taking into account the mapping we created in the earlier screenshot.
    Id batchinstanceId = Database.executeBatch(
      new MDPERSONATOR.MD_PersonatorBatch(
        'SELECT ID FROM Contact LIMIT 10',
      true, true, true, 'Mailing Address Verification'), 100);

    You can execute the code through the dev console via the execute anonymous or through your own Apex Code.

    Salesforce CSBatch 02 ExecuteCode.png


How to see results from a Batch job

To see the progress of your batch job, go to the Apex Jobs section in Setup and the job and status will be listed there.
Salesforce CSBatch 03 SeeResults.png
Every record that is updated by a Clean Suite Batch Job will have a Result object upserted as part of the process as well. The result objects and their associated webservices are as follows:
  • MD_personatorResult__c (Personator Verification)
  • MD_globalAddressResult__c (Global Address Verification)
  • MD_globalEmailResult__c (Global Email Verification)
  • MD_globalPhoneResult__c (Global Phone Verification)

Frequently Asked Questions

Is there a limit to the number of records processed through a batch?
Not through our software but Salesforce does have a limit on the number of queries that can be performed at a time. So we suggest users stick to batches smaller than 50,000 records. More info on governor limits can be found here: https://developer.salesforce.com/docs/atlas.en-us.234.0.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_apexgov.htm
Can I run a batch job automatically?
Yes you can run a batch job through Salesforce’s Scheduled Jobs section. You will need to create a new job using similar APEX code in the example above.
Is there a way to run these batch jobs without having to write code?
We plan to release a control panel in the future for Clean Suite Batch Jobs.