Number of statement execution limit exceeded on deluge scheduled function

Number of statement execution limit exceeded on deluge scheduled function

I'm working on a send email functionality in creator that sends out crew work orders at the end of the day each day for the next day. I'm running into the issue that zoho is unable to handle the number of statements that I am doing to be able to successfully send out all my emails. The function itself is a little complex with sorting jobs and mapping, roughly 20-30 jobs a day between 25-40 crew members. I did some work on the code to try and reduce some of the complexity of it by removing form look ups and nested for each loops. With that being done I've only been able to move from 9 emails my original function had to somewhere between 23-26 with my refactored one. I was wondering if anyone had any ideas on how to best get over this since Ideally the function would be able to send around 50 emails so I don't have to worry about failures. I looked a little into batch workflows or having specific scheduling functions for different branches of the business ( 3 branches with about equal number of jobs per, although unequal crew numbers {25,10,5}. 

Im hoping if I attach both version of my code someone can take a peak at them and let me know the best path forward. It would also be helpful if anyone had a link to how zoho tracks statement executions, if they are all equal or if some have more value. 

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ








                                ご検討中の方