You need to sign in to do that
Don't have an account?
madhava ramana 7
I am trying to retrive value from more than 2000 records, so in the process, i want to fetch the id value of 2000th record and assign it to a variable.Please let me know the syntax.
I am trying to retrive value from more than 2000 records, so in the process i want to fetch the id value of 2000th record and assign it to a variable.Please let me know the syntax.
If this answer helps you, please mark it as accepted.
Regards,
Tushar Sharma
https://newstechnologystuff.com/
you may want to elaborate on what exactly you want to achieve when you say 'fetch the id value of the 2000th element.
From experience you are probably updating many records and, as gouvernor limits hits at 2000, you need to pass where you stopped.
If you want to do mass update, you would be better off with automated process to do the handling of where you left it off.
The Batchable class can help you manage the indexing of the different blocks this way you actually don't need to worry about where you left the process.
here is an example of code that does the trick for mass update of ALL contact emails and add a .test at the end (we use it in our sandboxes to avoid sending emails to contact)
I'd be happy to further help you if you give more information about what you are truely trying to achieve.
best