In Oracle APEX 22.1, I am facing "Current version of data in database has changed since user initiated update process." error on deleting the rows.
My Interactive grid contains rows which has master row and few detail rows in the same grid. So, according to the business logic in the trigger, deleting just only the master row deletes all the child rows automatically in the grid. However, on selecting all the rows on the grid and deleting them, throws the above error. I am assuming it is because in the DB, because of the trigger the rows are already deleted and APEX engine is unable to find those rows.
Any idea if there is any tweak that can be done?
I tried adding Validations to check, if the row exists or not. But could not really achieve what to do.
This sounds like expected behaviour. The interactive grid is trying to delete the rows but when it tries to delete them the lost update detection mechanism will notice that the state of the rows is not the same as before the interactive grid was rendered. The state changed because the trigger deleted the rows so the can no longer be deleted by the IG. The IG cannot know if the change was caused by an another process or by another user changing data at the same time. If it was because another user manipulated the data at the same time, the error message would be appropriate.
A solution would be to use a custom process instead of the native IG process. Here is a blog describing how you could do that.