I have a situation where autoSave is OFF.
I have done a controller.newRecord() on my ordertable.
Now I want to select a customer from a selection screen.
The find works perfect, that is not the problem. The find() return true. The problem is when I return to my orderform, that my new order is already saved, while autoSave was still OFF
I saw in the documentation that sometimes there is a comment
//to search based on the find request in columName
//with autosave enabled; no unsaved records
if (controller.find())
{
columName = 'value';
controller.search();
}
So the autoSave does influence the find. In the documentation (DevRefGuide 3.5 page 424) I saw the following:
Function find
Initiates a find request; returns true if the find is successful; find will fail if autosave is
disabled and there are unsaved records.
In my case the autoSave is OFF and I did newRecord, so there are unsaved records, but the find() doesn’t return FALSE.
I am using 3.5.4 and have come across something similar. It’s probably my misunderstanding of something but I thought I would ask.
I have a FID that already has a record created. I need to allow the user to edit the record, but be able to change the client for that record. To do this I have a search box where they can do a search on the client table and in another fid show a results list where they can pick.
I turn autosave to false before the window opens. If I make any changes to the record, then perform the search, the record is saved even though autosave is still false. Therefore if they cancel out the changes are kept.
In looking through the forum I can’t really tell if this is expected behavior as my find works ok.
Thanks!
—Edit—
If I change my initial form to come from the same table as the search, it works fine. If I change my initial form to another table, then it doesn’t work.
So in my case I am looking at a record in “appointments” but need to change the person with that appointment by calling a search from “registration”.
I reported it as a bug, but Servoy says that this is exepected and normal behaviour when doing a find/search.
So now i am not using Find/Search but I create a query based on the
search criteria the user enters in the searchform and then i use controller.loadRecords based on that query to present the user with the search results.
The user then selects a record , etc.
This works fine, no save is done in the underlying form.
Forgot to mention the caseid i created for this one :
112621
Below the answer from Servoy :
all unsaved records are in in one pool, and have to be saved before search, since they might influcence the search! (records can have related data which are relaed to the search you try todo)
Regards Servoy Support