Hi, I need to write a deluge custom function that takes the records from one module (around 10,000), process them one by one and then insert them in another module (api v2).
If I'd do it in one function it looks like I'd immediately hit the 5,000 statements limit but what will happen if I:
- start a loop in the main function
- get the records 100 per time (the maximum is 200 but the insert has a limit of 100 so using the same size is simpler); I will fetch only the relevant fields from a view
- send the result to a different function that does the processing (around 20 statement per record so 2,000 statement per call) and returns the result to the main function
- insert the result in the new module
- loop until all the records are processed (around 100 times until getrecords returns an empty list)
Will it work or will I hit the limit somehow? If I hit the limit what would be a good workaround (to automate the process and avoid to manually do an export and then an import)?
Hope someone can help.