Trying to delete selected records with OnClick in statless form.

Trying to delete selected records with OnClick in statless form.

 Ok, here is my goal. I want to delete selected records with a stateless form. I'm using a checkbox to determine which ones are deleted in the main form.

Name of the main form: claim

Name of the checkbox: Extended

Name of the stateless form: Clean_Up


code for On Load of Clean_Up

     
  1. deleteList = claim [Extended == false];
that is a 'fetch records' function. I don't even know if that is the right way to start.

code for On Click of Clean_Up
        
  1. cutOffTimeMicroSeconds = (zoho.currenttime.toLong() - 5 * 24 * 60 * 60 * 1000);
    cutOffTime = cutOffTimeMicroSeconds.toTime();
    for each deleteList in claim
    {
    delete from claim[ Added_Time < cutOffTime ];
    }





That is to clean up the selected records.

Basically I want to delete records older than 5 days that have not been 'Extended' by an admin.


Can someone show me what I'm doing wrong?