For each record - hitting deluge statement execution limit - to only update 730 records across 2 forms???

For each record - hitting deluge statement execution limit - to only update 730 records across 2 forms???

Hello,

I have trying to update 730 records across 2 forms as follows:
- Create booking = 365 records
- My availability form = 365 records

These are daily recurring events for a period of 1 year, which are set up in "My availability form" then inserted in "create booking" form.

Both form are linked via lookup field through their ID
Create booking has lookup field My availaibility_form_ID
My availability form has lookup field create_booking_ID

For each series (across both form) there is a unique reference number and record in the series is numbered.

I am trying to update events in the series across both forms, however - whichever script I am using - the message is always the same:

"The number of deluge statement execution limit exceeded the maximum limit."
- I find it hard to find how and where I hit the 1500 limit.

Here is the latest deluge script I have been using on "edit"

if (((input.Update_all_associated_recurring_events  &&  (rc.Reccurance  =  "Daily"))  &&  (per.Select_period  =  "1 year"))  &&  (input.Number  >=  1))

  //updating series of event in My Availability Form
{
    for each r in My_availabilities_form  [Reference_recurring_event = input.Reference_recurring_event] sort by  Number  range from 1 to 365
    {
        r.Absence_type = input.Absence_type;
        r.Start = input.Start.addDay((r.Number  -  input.Number));
        r.End = input.End.addDay((r.Number  -  input.Number));
        r.Event_title = input.Event_title;
        r.Description = input.Description;
        r.Select_period1 = input.Select_period1;

       
        // updating series of event in Create Booking

        for each r2 in create_booking  [(My_availabilities_form_ID = r.ID && Reccurring_event_reference = input.Reference_recurring_event)] sort by  Number  range from 1 to 365
        {
            r2.Date_time = r.Start;
            r2.Description = r.Description;
            r2.End_time = r.End;
            r2.Event_title = r.Event_title;
            r2.Item_code1 = r.Absence_type;
            r2.Job_type_1 = r.Job_type;
        }
    }
}


I was wondering if any of you had any suggestion and guidance on this

Thanks in advance for looking at this,

KR
Claire