RE: 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.
Hey Dominicb, thanks a lot for your reply here,
Yes you are correct, its more than 200,000 transactions, need to be updated,
do you have any sample code (or) any idea how to yield and automate the script process, so that there should not be any kind of disturbance while updating records, and all process should go smoothly. thank you.
Sorry, but I don’t have anything I can share, as anything I have is covered by my employer’s NDA. You shouldn’t however have to do anything special with a map/reduce in order for it to yield and restart. If you search in Help for “SuiteScript 2.0 Map/Reduce Script Type” there are sample scripts.
What error were you experiencing with your map/reduce and at what stage did it occur? If it’s failing and not restarting, it may be that the issue is to do with hitting the hard memory limit (which was 50mb, but may have changed) rather than governance. In particular, with large operations, you really want to return minimal data from the getInputData stage – or just return a reference to a single column search ID for records to be worked on.
Thank you 🙂