3.5.5 - controller.Delete in Module

Hello,

I am having difficulty with what should be very routine. A child form (ie - via relation in a tab) is not able to delete a record via a basic issuance of controller.delete in a form level method (something I have done many times before) within the child form.

This particular form exists within a Module that is included in the Main solution. I have checked the following:

  1. Relations are properly formed and the correct checkboxes in place;

  2. The form will delete a record properly in the Module it was written in. The foundset count drops properly and the database appears to accept the row delete (checked the backend db, Postgres, for constraints running) just fine. Database is accepting row deletes properly via PgAdmin Console.

  3. The method is running (I come up to controller.delete line of code and it sails right through this line of code)

  4. That the module is properly included (I have also tried removing and re-adding the module)

  5. There are no conflicting relationships (checked thoroughly). However, I did add a child-to-parent relation (opposite of the normal parent-child that remains in production) during the day of development and, yes, I did remove it. This one point concerns me … does it have an impact somehow ?

  6. I made the edits to the delete method (ie - the module) from within the main solution. The code appears to have taken properly (and executes fine if I open the module itself and run the code - it will delete just fine at the module level … per point 2.).

Suggestions?

Thanks, Michael

Something to try… While in the main solution, go directly to the child table (so it is the main form) and find a record that you weren’t able to delete. Then try to delete it using the Select → Delete Record. If that doesn’t work, it is probably one of these things below (most likely a relationship issue)…

Relationshp Issue: The child table is a parent table to any other tables through a relationship that isn’t allowing parent delete

Event: Is there an onRecordDelete method not allowing records to be deleted?

Security: Does the user have acces through servoy security to delete the record in that solution?

Relationshp Issue: The child table is a parent table to any other tables through a relationship that isn’t allowing parent delete

Scott, this was the issue - I missed a lower level child table (ie - down 2 levels from the parent … the level 2 child had a parent constraint running against the level 1 child).

Your test 1 worked fine (in the Module for this form) but not in the main Solution - signaling likelihood of a relationship problem. My module did not have knowledge of the level 2 data provider and relationship so it ran fine within the subordinate module. This behaviour across module level and solution level was helping contribute to my rabbit-trail :lol:

Quick tweak of the global relationship definition in the Main solution and away it went.

Thanks! Appreciated,

Michael