Activity › Forums › Salesforce® Discussions › When a BatchApexworker record is created in batch apex in salesforce?
Tagged: Create Record in Salesforce, Salesforce Apex Class, Salesforce Batch Apex, Salesforce Records
-
When a BatchApexworker record is created in batch apex in salesforce?
Posted by suniti on July 3, 2018 at 12:51 PMWhen a BatchApexworker record is created in batch apex in salesforce?
shradha jain replied 7 years, 8 months ago 5 Members · 4 Replies -
4 Replies
-
Hi suniti,
For each 10,000 AsyncApexJob records, Apex creates one additional AsyncApexJob record of type BatchApexWorker for internal use. When querying for all AsyncApexJob records, it is recommend that you filter out records of type BatchApexWorker using the JobType field. Otherwise, the query will return one more record for every 10,000 AsyncApexJob records.
- [adinserter block='9']
-
BatchApexworker is an picklist value in AsysncApexJob Object . When ever you will execute an Batch apex in salesforce it will create two record in AyncApexJob Object with two different JobType (BatchApex/BatchApexWorker) .
The record with jobType BatchApexWorker will contain the last processed recordid and ParentJobId as the reocrd with Jobtype BatchApex .Thanks
-
Hi,
To add more –
BatchApexworker used internally by Salesforce. For each ‘AsyncApexJob’ record of type ‘BatchApex’, Apex creates for internal use an ‘AsyncApexJob’ record of type ‘BatchApexWorker’ per 10,000 records to be processed. When querying for all ‘AsyncApexJob’ records, we recommend that you filter out records of type ‘BatchApexWorker’ using the ‘JobType’ field to avoid returning more than one record for each ‘AsyncApexJob’ record of type ‘BatchApex.’
Hope this helps.
-
Hello suniti,
Each time batch Apex is invoked, it creates an AsyncApexJob record. You can use the ID of this record to construct a SOQL query to retrieve the job’s status and progress. Apex creates one additional AsyncApexJob record of type BatchApexWorker for internal use for every 10,000 AsyncApexJob records.
Log In to reply.