function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sunil AroraSunil Arora 

Problem in Bulk update


I am fetching n number of records from a custom object(If the records are more than 1000,then it is showing exception),then trying to update Opportunity in some conditions.If I insert Opportunity manually,then trigger works fine,but if we insert 30-40 Opportunity records through data Loder ,then it is showing error/exception.

First Query:- If we get a single record from select call,then its very simple to use it for bulk update,but if we get multiple records from select call,then is it possible to use it for bulk update??

Second Query:-

How can we fetch more than 1000 records through Apex Trigger??
First query:
Total number of records retrieved by SOQL queries 1,000.  These limits scale with trigger batch size. The limit is multiplied by the number of records submitted. For example, if your batch process contains 200 records, your script may retrieve as many as 20,000 records.

Second query:
You cannot fetch more than 1000 records within a single record trigger invocation.  If 20 records are pulled into the trigger invocation (eg: from an API update request with a batch size of 20) - you can then fetch 20,000 records.
Sunil AroraSunil Arora

Thanks for the reply.I gone throgh that document,but I am still struggling,how to fetch more than 1000 records through trigger.

Syntax or example would be much appreciated.