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));
            }
        }
    }
    }
  • 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 – David Mycka Feb 21 '17 at 22:38
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.

  • 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. – David Mycka Feb 21 '17 at 22:37
  • @DavidMycka That would queue 150 Queueable calls, which would all be processed in due time. – sfdcfox Feb 21 '17 at 22:43
  • Wouldnot it blow 50 jobs limits – David Mycka Feb 21 '17 at 22:48
  • 2
    @DavidMycka nope. The 50 limit is per transaction. There would be 150 separate transactions. – sfdcfox Feb 21 '17 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 – David Mycka Feb 22 '17 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.