Hello,
since Servoy 3.5.9 I have an issue that ‘controller.deleteRecord()’ or ‘foundset.deleteRecord(index)’ is deleting the whole foundset and not the only one record it should be!
The record to delete is displayed as List (Table view) in a relationless Tabpanel. I tried also other combinations, but always the same.
Thomas
Servoy Developer
Version 3.5.9-build 522
Java version 1.6.0_07-b06-57 (Mac OS X)
in my solution I have defined ‘User Groups’. Every record is allocated to a specific user_group managed by the user login. If an user is ‘group_1’, all records created by that user get the value ‘group_1’ in ‘user_group’.
In the current issue I have a list in front (application.showForm(list)), no relations and property functions are default, with for example 100 records. 20 of this have the value ‘group_1’ in the column ‘user_group’, 50 ‘group_2’ and so on. When I delete one of the 20 ‘group_1’ records by method (controller.deleteRecord()) or Menue Bar (Select > Delete Record), all 20 ‘group_1’ records are deleted.
In the solution I have comparable functions, created in previous Servoy Versions, and they are working well. The issue appears only to the new functions in the solution, made in Servoy 3.5.9.
tgs:
Every record is allocated to a specific user_group managed by the user login. If an user is ‘group_1’, all records created by that user get the value ‘group_1’ in ‘user_group’.
How is this group_1 automatically being filled in ? You create the records over a relationship (global to record) ?
tgs:
When I delete one of the 20 ‘group_1’ records by method (controller.deleteRecord()) or Menue Bar (Select > Delete Record), all 20 ‘group_1’ records are deleted.
I highly suspect that you are using a relationship that links/filters the records on that group id and that it has the “Delete Related Records” checkbox enabled.
tgs:
Every record is allocated to a specific user_group managed by the user login. If an user is ‘group_1’, all records created by that user get the value ‘group_1’ in ‘user_group’.
How is this group_1 automatically being filled in ? You create the records over a relationship (global to record) ?
I store the user_group value in a globale for every logged in user and fill in the value ‘group_1’ and so on manually (by methode). In the case of the issue I create new records by relationship, but I get the same result when I import the records from a textfile or create records by ‘forms[form].controller.newRecord(arg1,arg2,…)’.
tgs:
When I delete one of the 20 ‘group_1’ records by method (controller.deleteRecord()) or Menue Bar (Select > Delete Record), all 20 ‘group_1’ records are deleted.
I highly suspect that you are using a relationship that links/filters the records on that group id and that it has the “Delete Related Records” checkbox enabled.
I don’t use the relationship deleting a record. The checkbox “Delete Related Records” on the Define Relation-Dialog is unchecked.
When I display the list form as main window with 100 records (group_1 = 20 records, group_2 = 50 records, group_3 = 30 records), activate one row of a group_1 record and delete this row, the other 19 rows are deleted, but the row I have activated still exists (by deleting by Menue > Select > Delete Record without any operator)!??
I could fix the problem. I actually found a recursive relationship on the table with a checked “Delete Related Records”! I’m sorry
Thank you for your taken effort.
I have a forgotten old relation on the table to itself with the key ‘user_group’. The relationship is not in use in any function, but I have unchecked the ‘Delete Related Records’ checkbox and now deleting is working as it should be. I had to check first for relations. Sorry for that mistake.