1

I would like some help over below:

I have an use case where due to Apex CPU timout limits i would like to make this trigger in asynchronous with other objects. I was wondering Since sales force has limits for 50 jobs per queue able, would that mean when my data loader run with batch size 200, how many queueable will form. Will Transaction mean, one transaction of 200 records or total number of records will count in one transaction

Trigger on Wind_pipes__c (before insert, before update, after insert, after update)
    {
     if (Trigger.isAfter && (Trigger.isUpdate || Trigger.isInsert)) {

           System.enqueueJob(new WindPipeHandler(Trigger.newMap));
            }
        }
    }
    }
1
  • I would like to load 30,000 records through on file from dataloader batch size set to 200. How many queueable will the there, will it blow limit of 50 or not Commented Feb 21, 2017 at 22:38

1 Answer 1

3

Since there's no loop, there's just a single Queueable being called. You'd still have 49 more invocations available for the transaction.

6
  • Thanks sfdcfox for quick reply. What if i have file which have 30,000 records and i will load this through dataloader with batch size 200. Commented Feb 21, 2017 at 22:37
  • @DavidMycka That would queue 150 Queueable calls, which would all be processed in due time.
    – sfdcfox
    Commented Feb 21, 2017 at 22:43
  • Wouldnot it blow 50 jobs limits Commented Feb 21, 2017 at 22:48
  • 2
    @DavidMycka nope. The 50 limit is per transaction. There would be 150 separate transactions.
    – sfdcfox
    Commented Feb 21, 2017 at 22:59
  • Thanks sfdc fox, would that means for every batch size for example if i set batchsize=100, then for those 100 records it will count as one transaction with 50 limits, then second batch will next 100 records will have 50 limits again and so on Commented Feb 22, 2017 at 5:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .