I have a main form with a navigation form, both with tab panels. The main form tab panel contains record view forms, while the navigator tab panel has list view forms with the same data as the main form: choosing one record in navigator shows the details in the main form.
I put a button on the navigator form with a method to sort the records using controller.sort, but it doesn’t work. The records are not sorted at all. I tried using controller.sortDialog in case my method was wrong. Same result: nothing.
I changed the method with a simple “SELECT … ORDER BY…” SQL statement followed by controller.loadRecords and everything works as expected. Any idea?
Thank you Maarten for your reply. My method was correct as per your suggestion, so the problem should have been elsewhere.
I spent almost the whole night, but at last I got the answer: before the controller.sort command I had to execute databaseManager.saveData. Autosave is set to false and, for some reason, there is an unsaved record somewhere. Probably one I use in certain service forms to get feedback from the user.
The autoSave(true/false) function is useful but causes a lot of headaches. I hoped it would have been improved in 3.1 but it appears that this is not the case, at least in rc1.