0

Timer for delete record

there is a table where a lot of records are collected during the day. After 10 days, they are no longer relevant, and i need to delete them if there is no comment and claim from the buyer. Can I create a formula for automatic deletion?

3 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    There isn’t a “timer” in Ninox. You can:

    1. Create a formula then have it run when you open the DB, or table, or tab
    2. Put the formula in a button, that you have to click every day
    • Mel_Charles
    • 1 yr ago
    • Reported - view

    As Fred states ....

    You can automate in a kind of way by tracking the current date less x

    I used this code in the GLOBAL script area to delete old jobs and its associate child forms over approx 6 years old (ie ignoring leap years etc

     

    but as this one run when you log on also have an admin table form and have this in a button too ! for admin type tasks

    let myDate := today() - 2190;
    let myDel := dialog("Delete Multiple jobs from History File", "DELETE ALL JOBS OVER 6 YEARS OLD FROM CURRENT JOB FILE?

    Warning:- Once these jobs have been Deleted - They are gone forever!", ["Yes", "No"]);
    if myDel = "Yes" then
        let mySure := dialog("Sure?", "Are you Sure?", ["Yes", "No"]);
        if mySure = "Yes" then
            delete (select PurchaseOrders where 'Order Date' < myDate);
            delete (select DeliveryNotes where 'Delivery Date' < myDate);
            delete (select JobDockets where 'Order Date' < myDate);
            alert("Records have been deleted from the system")
        else
            alert("Okay - Nothing has been deleted")
        end
    else
        alert("Okay - Nothing has been deleted")
    end

      • ekalcasino777
      • 1 yr ago
      • Reported - view

      Mel Charles Thanks for help

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 3Replies
  • 90Views
  • 3 Following