0

Simple delete button for the current record

How can i create a simple delete button for the current/open record?

Layout element > button > formula

Many thanks, Maarten

9 replies

null
    • Support
    • 6 yrs ago
    • Reported - view

    Hi Maarten, 

    You can use the formula

     

    delete()

     

    But please be aware: If you only use that formula it will delete the data record imediately.

    More information about that function you will find in our User Manual here: 

    https://ninoxdb.de/en/manual/calculations/reference-of-functions-and-language

    We would suggest to use the waste basket symbol in Ninox in order to delete the current record.

    Best, Jörg

    • AppWeaver_Maarten_Thiebo
    • 6 yrs ago
    • Reported - view

    Hello Jörg,

    Many thanks, I'm using it for Todo items that don't need an extra confirmation.

    The correct formula is

    delete(this)

     

    Best, Maarten

    • Jaime_Blanco_Landau
    • 4 yrs ago
    • Reported - view

    Hi,

    how can I get a confirmation pop up before delete the record?

    Thanks.

    • Mconneen
    • 4 yrs ago
    • Reported - view

    Refer to the dialog function.. 

    dialog("Delete", "Are you sure you want to delete this record?", ["OK", "Cancel"])

    Be advised .. dialog does not work the same in all platforms and will not fire with all triggers.. so best to put it behind a button.. 

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    let result := dialog("Warning", "Are you sure?", ["Yes", "No"]);
    if result = "Yes"
    alert("Deleted");

    delete (this)

    else
    alert("Canceled")
    end

    Steven

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    Oops...

    • English Noil
    • Antonio_Toledano_Reyes
    • 4 yrs ago
    • Reported - view

    Hi, tried but Im getting this error , any ideas ?

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    It should be :

    let result := dialog("Warning", "Are you sure?", ["Yes", "No"]);
    if result = "Yes" then
    alert("Deleted");

    delete (this)

    else
    alert("Canceled")
    end

     

    Steven.

    • English Noil
    • Antonio_Toledano_Reyes
    • 4 yrs ago
    • Reported - view

    Thanks ¡¡ works great

Content aside

  • 4 yrs agoLast active
  • 9Replies
  • 4070Views