deluge statement execution limit

deluge statement execution limit

Hi. I have function:
  1. float z(float k, float g)
  2. {
  3.     // size = XS and 6
  4.     s = 0.0;
  5.     if ((input.k  <  700)  ||  (input.g  <  700))
  6.     {
  7.         s = 6;
  8.     }
  9.     // size = S and 8
  10.     else if (((input.k  >=  700)  &&  (input.k  <  900))  ||  ((input.g  >=  700)  &&  (input.g  <  900)))
  11.     {
  12.         s = 8;
  13.     }
  14.     // size = M and 10
  15.     else if (((input.k  >=  900)  &&  (input.k  <  1100))  ||  ((input.g  >=  900)  &&  (input.g  <  1100)))
  16.     {
  17.         s = 10;
  18.     }
  19.     //size = L and 10
  20.     else if (((input.k  >=  1100)  &&  (input.k  <  1300))  ||  ((input.g  >=  1100)  &&  (input.g  <  1300)))
  21.     {
  22.         s = 12;
  23.     }
  24.     //size XL and 14
  25.     else if (((input.k  >=  1300)  &&  (input.k  <  1500))  ||  ((input.g  >=  1300)  &&  (input.g  <  1500)))
  26.     {
  27.         s = 14;
  28.     }
  29.     // size XXL and 17
  30.     else if (((input.k  >=  1500)  &&  (input.k  <  1800))  ||  ((input.g  >=  1500)  &&  (input.g  <  1800)))
  31.     {
  32.         s = 17;
  33.     }
  34.     // size XXXL and fact
  35.     else if ((input.k  >=  1800)  ||  (input.k  >=  1800))
  36.     {
  37.         s = input.k;
  38.     }
  39.     return s;
  40. }
When i called function (on update) for all records (about 1800 records):

  1. for each record in New_price
  2. {
  3.     record.S = thisapp.z(input.K, input.G);
  4. }

i get error:

Error details:
Error Executing the workflow On Edit - On Success script.
The number of deluge statement execution limit exceeded the maximum limit.