I have an odd problem with a few of my solutions
I have a parent 'sale' record, which has no relation to a tab with 'line items'.
When the parent sale record is selected, it does a sql query on the table with line items, and returns all of the items belonging to that 'sale'. The reason I don't use a relation is that I want the line items to be selectable by group (show this group of line items for this sale, or that group for this same sale, etc.).
My code to retrieve the dataset onRecordSelection of the 'sale' is:
- Code: Select all
var sql_query = "SELECT line_itemsid, sales_id, hidden_from_estimate "
+ "FROM line_items "
+ "WHERE sales_id = ? AND hidden_from_estimate != 1"
var vDataSet = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), sql_query , [forms.sale_master.salesid],-1)
forms.line_items_complex_master.controller.loadRecords(vDataSet)
When I do a search for a particular sale (specifically nr. 169) in a live system, it shows only 6 line items. However when I go to print that sale, it reloads the dataset (to eliminate the group you may have been on), loads the line_items records for that sale into a print form, and prints, and always loads the correct number of lines (26 lines).
If it is 'stuck' on 6 lines, and I go to a form that has nothing but line items, and search manually for sale id 169, it shows only 6 records, however, if after trying to print I do the same thing, it shows 26 lines.
There some tableFilterParams, and foundsetFilterParams in various methods, but they are all commented out, and there are no calls to clear the filters anywhere (so if it is that, how do my 26 records get restored after trying to search for the items as part of a print?)
It is repeatable and consistent, and always initially shows 6 lines for that one sale, but all other sales are fine, and always prevents me from finding the full 26 if I search a form with just line items on it.
If I load all lines by trying to print, and then quit / restart client, I get the problem back.
Anyone seen anything like this before?
Bevil