Schedule a function that exceeds number of statement execution limit

Schedule a function that exceeds number of statement execution limit

Hi guys, 

I've got an error on a schedule that I'm running to update the age of my service users. It says the number of statement execution limit is exceeded. Each day I use a schedule to run the following function: 

void update_age()

{

for each  rec in Service_users

{

if(rec.Date_of_birth != null)

{

rec.Age=(((zoho.currentdate - rec.Date_of_birth)) / (1000 * 3600 * 24 * 365)).toLong();

}

}

}



Is there some other way I should do this?

Thanks in advance for any advice. I might just not be thinking this through properly. 

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      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 Campaigns 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 コンテンツ




                              ご検討中の方