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
iSfdciSfdc 

Update bulk data in Salesforce

Hi,

I have a requirement of updating 500,000 records within Salesforce. (When I modify a record in Object: A, all the Object: B records should be modified).

Can you suggest a better approach so that I am not hitting the governor limit in Apex.

Any pointers would help me to start with.

Thanks. 

 

WilmerWilmer

Well, I think this is not possible by a trigger because of the governor limits.

 

Perhaps, and according to your requirement, what you could do is to mark the record in object A with an internal checkbox and later (no imnediately), helped by a combination of Apexwebservice and Scripting Toolkit (called by a automatic task in a PC or server) you could handle the limits in a bulk process.

 

The Apex webservice should go and find every marked record in object A and for each one, look for the related records in object B to update the required value. The point is that with this strategyyou can manage packages to to process and then handle the governor limits.

 

I hope this helps.

 

Regards,

 

Wilmer