Tuesday 10 January 2023

Salesforce Collections Best Practices

 1. How many number of items can be added into a Salesforce Collection (List/Set/Map)?

     No Limit, Earlier it was 1000 but later it's been removed but keep in mind if you add more number of items it will lead to the Heap Size Error, Means too much data is being stored in memory during processing,6MB for synchronous transactions and 12MB for asynchronous transactions.

Fix have the SOQL query with as many as filter conditions and have the low number on the limit of records to be returned, To add to the list & Have the declaration with in required scope only.

No comments:

Post a Comment