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?

Rookie Asked on June 17, 2020 in SuiteScript.
Add Comment
2 Answer(s)

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.

Beginner Answered on June 17, 2020.

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.

on June 17, 2020.

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.

on June 17, 2020.

Thank you 🙂

on June 22, 2020.
Add Comment

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)

 

Rookie Answered on June 19, 2020.

Thank you 🙂

on June 22, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor