I think I have a relation problem, preventing me from deleting a record. I’ve tried to find answers before posting, but I’m stuck.
I don’t see any errors in the logs, when looking at the Admin console.
I wasn’t getting any errors when running this code:
“forms.Add_a_book.foundset.deleteRecord(row)”
I am setting “row” properly and have verified I have the right row.
It passes right through the deleteRecord line without any complaints, but the row never gets deleted.
I read a bunch of posts about needing to turn on the checkboxes in the relations. I turned them all on for all my relations, trying to troubleshoot this, but here’s the message I’m getting now:
com.servoy.j2db.dataprocessing.DataException: DELETE statement conflicted with COLUMN REFERENCE constraint ‘fk_package_lookup_child_item’. The conflict occurred in database ‘OSBDB2’, table ‘PACKAGE_LOOKUP’, column ‘item_child’.
org.mozilla.javascript.JavaScriptException: com.servoy.j2db.dataprocessing.DataException: DELETE statement conflicted with COLUMN REFERENCE constraint ‘fk_package_lookup_child_item’. The conflict occurred in database ‘OSBDB2’, table ‘PACKAGE_LOOKUP’, column ‘item_child’.
I created a new form with just this table and it still give me these errors.
I checked my security and I’m logged in as admin.
I checked the database and I can delete records with SQL directly.
I don’t have any other methods running anywhere.
I think the problem is with the relations somewhere, but I just can’t figure it out.
I have relations between 3 tables:
packages to package_lookup
packages to items
package_lookup to items
An item can be a package.
If it is a package, there will be a record in packages.
Package_lookup is the join table that has a record for each component item in the package, along with the package_id.
I’m trying to build a screen that let’s me delete a component record out of the package_lookup table. Everything works, except the final deleteRecord call.
HELP!!