I have a foundset that I am trying to delete a record from and it keeps throwing !servoy.foundset.error.noParentDeleteWithRelatedrecords! . I have tried every combination of " Allow parent delete when having related records" and “Delete related records” on all the relations that could possibly be used in this found set with no results.
Is there any way to get a little more information on exactly what relation is the problem? All of the mentioned relations where all auto-created from the database foreign keys, and the deletes cascade properly in the database (MySQL) if I do it manually, just servoy wont let them happen.
I have tried 4.0.1 and 4.1b4 with the same results
The relations checked are the relations with primary table the same as the foundset table, this is the same set as shown under the relations node below a form based on the same table in developer (4).
If there is one relation that has the option ‘allow parent delete when having child records’ turned off the delete will fail with the reported error.
Note that a relation with the option ‘Delete related records’ on will cause delete of data in another table. A relation on that table could also block the delete.
Hi Rob, I think Ryan means that if it is possible that Servoy could give us the relationname that does the block!
I have had this also once, and it will cost you (in a big solution) a lot of time to found out, which relation blocks it.
Delete not granted due to AllowParentDeleteWhenHavingRelatedRecords size: 1 from record with PK: 1.3; index in foundset: 3 blocked by relation: orders_to_order_detail
In the smart client it should show up in the java webstart console when opened.
I seem to remember that this worked exactly as Rob describes. However, I have the same problem again and can’t find which relation is blocking the delete. I don’t have any information in the log file (/Servoy/application_server/servoy_log.txt) and the Console application in OS X only gives me
This is the same information I get in the Servoy Debug Console. In the Java Preferences I have tracing and logging enabled.
I checked all relations that involve the table in question and all of them have the option “Allow parent delete…” enabled.
xtsr:
can’t find which relation is blocking the delete
I’m sure there must be one…
If you can use the SolutionModel, why don’t make things easier?
Just write a piece of code that scans all your relations and their settings.
Filter out the ones that can bug you and then check for ‘related records’.
5 minutes of work, years of fun!