Delete Record trigger throwing error

I have a trigger set up to delete a table record each time the delete button is pressed. It works fine when the app is running on test mode, but when I deploy to production It doesn’t work. It displays the following error message, “Record with ID … is currently being used. Please finish any apps using this record and try again.”

I think a little more context in how you are deleting the record is needed, but I can give an example for why I had some issues with delete.

In order to find out what record ID you want to use to delete a record, you need to either load a record using an interactive table or use a table aggregation to find out what the record ID. In my case, I often use the interactive table.

When someone clicks the interactive table, it automatically enters that record into the record placeholder. When I try to delete the record now, the app will throw an error saying that the record is currently being used (in your current app). Therefore, you need to save the table record ID into a separate variable, clear the record placeholder (so the record is no longer in use), then you can delete the record from your table using the in app trigger.

If this error is still occurring, then maybe the record is actually being used by someone else in another app.

In a nutshell: Maybe the record you are trying to delete is still loaded into the record placeholder in the same app. Therefore, you can’t delete a record by referencing it’s own table record ID. You need to save the ID elsewhere, clear the record placeholder, then delete the record.

1 Like

Thank you! I am using an interactive table, and I was able to resolve the issue by saving the record ID into a variable when a user clicks on a table record. I then cleared the record placeholder before deleting the table record from the table.

I am experiencing a second issue with the same interactive table: each time I add a record to the table, It doesn’t display in real-time. I can only see the added record when I restart the app.