Salesforce:Custom Batch Processing
Custom Batch Processing
Note: This section is for advanced salesforce users/developers. Before proceeding, it is recommended that you have a fundamental grasp of SOQL and are comfortable with APEX code. Make sure all settings are correct before running a batch job, as batch jobs can result in unexpected record processing if not careful.
Starting a Batch Job
An example of how to start up a batch job:
Id batchinstanceId = Database.executeBatch(new MDPERSONATOR.MD_PersonatorBatch('SELECT FirstName, LastName, MailingStreet, MailingCity, MailingCountry, MailingPostalCode, MailingState, Email, Phone, MailingLatitude, MailingLongitude FROM Contact', true, true), 100);
The part highlighted in cyan is the SOQL query and is how they specify what subset of records need to be processed. When SELECTing the fields, you must SELECT all the fields that mapped under the “Listware Advanced Mappings” tab for both the input and output. You can run the SOQL query:
SELECT MDPERSONATOR__inputMap__c, MDPERSONATOR__outputMap__c FROM MDPERSONATOR__MD_customMappings__c
and see the API names of the fields that were mapped in.
The part highlighted in purple are two Boolean parameters. The first one, if set true, will tell the batch process to update the Salesforce records with the clean/standardized data using the output mapping specified in Listware. The second one, if set true, will process all records returned by the SOQL query regardless of whether the record has been processed before using Listware.
The last part, highlighted in yellow, should always be left to 100 and should not be adjusted.