Salesforce:Custom Clean Suite Batch Processing: Difference between revisions

From Melissa Data Wiki
Jump to navigation Jump to search
Created page with "← Clean Suite for CRM:Salesforce {{CustomTOC}} ==Batch Processing== ===What is Batch Processing and how does it work?=== Batch process..."
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Clean Suite for CRM:Salesforce|← Clean Suite for CRM:Salesforce]]
{{ListwareForSalesforceNav
|CustomCodeCollapse=
}}
 
{{CustomTOC}}
{{CustomTOC}}


==Batch Processing==
==Batch Processing==
===What is Batch Processing and how does it work?===
===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.
: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.
: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?===
<ol>
<li>Select the class of Melissa Endpoints to use from the following list:</li>
*MD_PersonatorBatch (Personator Verification)
*MD_GlobalBatch (Global Address Verification)
*MD_GlobalEmailBatch (Global Email Verification)
*MD_GlobalPhoneBatch (Global Phone Verification)


===How do I run a batch job?===
<li>Choose the object and mapping you want to use.</li>
#Select the class of Melissa Endpoints to use from the following list:
In the screenshot below we created a '''Contact mapping''' named "''Mailing Address Verification''" for the Personator Verification Web service.
#*MD_PersonatorBatch (Personator Verification)
 
#*MD_GlobalBatch (Global Address Verification)
[[File:Salesforce_CSBatch_01_ContactMapping.png|none|1000px]]
#*MD_GlobalEmailBatch (Global Email Verification)
 
#*MD_GlobalPhoneBatch (Global Phone Verification)
<li>Craft the query</li>
#Choose the object and mapping you want to use.
In the example below we specified the Object Type from above and that we want only 10 records.
##In the screenshot below we created a '''Contact mapping''' named "''Mailing Address Verification''" for the Personator Verification Web service.
<pre>SELECT ID FROM CONTACT LIMIT 10</pre>
#Craft the query
 
#:In the example below we specified the Object Type from above and that we want only 10 records.
<li>Craft the statement</li>
#:<pre>SELECT ID FROM CONTACT LIMIT 10</pre>
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.
#Craft the statement
<pre>Id batchinstanceId = Database.executeBatch&#40;
#: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.
#:<pre>Id batchinstanceId = Database.executeBatch&#40;
   new MDPERSONATOR.MD_PersonatorBatch&#40;
   new MDPERSONATOR.MD_PersonatorBatch&#40;
     'SELECT ID FROM Contact LIMIT 10',
     'SELECT ID FROM Contact LIMIT 10',
   true, true, true, 'Mailing Address Verification'&#41;, 100&#41;;</pre>
   true, true, true, 'Mailing Address Verification'&#41;, 100&#41;;</pre>
#:You can execute the code through the dev console via the execute anonymous or through your own Apex Code.
You can execute the code through the dev console via the execute anonymous or through your own Apex Code.
 
[[File:Salesforce_CSBatch_02_ExecuteCode.png|none|600px]]
</ol>
 


===How to see results from a Batch job===
===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.
: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.
 


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:
:[[File:Salesforce_CSBatch_03_SeeResults.png|none|1000px]]
*MD_personatorResult__c (Personator Verification)
*MD_globalAddressResult__c (Global Address Verification)
*MD_globalEmailResult__c (Global Email Verification)
*MD_globalPhoneResult__c (Global Phone Verification)


: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===
===Frequently Asked Questions===
;Is there a limit to the number of records processed through a batch?
:;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  
::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?
:;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.
::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?
:;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.
::We plan to release a control panel in the future for Clean Suite Batch Jobs.




[[Category:Reference]]
[[Category:Reference]]
[[Category:Clean Suite for CRM:Salesforce]]
[[Category:Clean Suite for CRM:Salesforce]]

Latest revision as of 01:53, 24 January 2023

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


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