Not able to fetch all customer records using ".setMaxFetchSize()" from groovy
Summary:
Trying to fetch all the 'Customer' Accounts in CRM using Groovy.
Content (please ensure you mask any confidential information):
We are trying to fetch all the 'Customer' Accounts in CRM using Groovy. For this we have created an Object Function and in this we have queried the Account object (OrganizationProfile). There are around 8000 Customer Accounts in CRM. We have used the function "setMaxFetchSize()" to get all the 8000+ records. We are calling this object function from a button and when we check the runtime messages, it is only displaying 500 records at a time.
But when we set a value in the above-mentioned method (say 10000), then it's giving the actual customer count.