Button fields that run scripts do not work in interfaces. You need to rework the script so that it can run as an automation. Then you can use a button element in the interface to trigger the automation. Note that it will take slightly longer for the automation to delete the record versus the button field.
There will have to be several changes to the script to make it run as an automation. For example, you will not be able to use cursor.activeTableId or input.recordAsync
If you don't want to figure out the automation script yourself, my Automation Helper Scripts on my Gumroad store includes an automation script for deleting a triggering record.
So are there equivalents to cursor.activeTableId or input.recordAsync to run a script through a button in a cell in an interface?
So are there equivalents to cursor.activeTableId or input.recordAsync to run a script through a button in a cell in an interface?
You can use a checkbox instead and it will work in the interface view
So in my example above, when you check both checkboxes you trigger an automation that will run a script and delete the record.
I am using the following script :
let table = base.getTable("💰📝 Lignes de commandes");
let inputConfig = input.config();
let recordId = inputConfig['recordId']
await table.deleteRecordAsync(recordId);
Hope it helps.