Simple delete button for the current record

Ninox Profile

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

Layout element > button > formula

Many thanks, Maarten

 

Ninox Profile

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

 

Ninox Profile

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

J

Hi,

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

Thanks.

Ninox Profile

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 Profile

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

delete (this)

else
alert("Canceled")
end

Steven

Ninox Profile

Oops...

Reply