How to handle a script to update 2 lack records with out hitting governance limits?
Recently we had a requirement to update more than 2 Lack records, we tried schedule script, its hitting governor limit, we moved to map reduce, again there also hitting governance… would like to know is there a way to handle script execution smoothly without hitting governance limits?
Assuming you mean 2 x 100,000, you are always going to hit governance limits operating on that number of transactions.
This shouldn’t however stop the task from completing. When it hits the governance limit, the script will yield and restart automatically.
You should be gathering / formatting all your data in the getInputData and passing forward one record at a time to Map.
If you are able to do this, governance will likely no longer be an issue unless you’re hitting the time based limit.
If you are able to share your code I’d be happy to have a look if it’d help. (you can always DM me in slack)