Hi All,
I have a problem with databaseManager.saveData() in my solution (Servoy Version : 5.1.4 - Build 964). Below is an example of the solution and not the actual solution.
databaseManger.setAutoSave(false);
var _success = false;
var _swap_serial_no = 'XXXXXXX';
var _original_serial_no = 'YYYYYYY';
var fs1 = databaseManager.getFoundSet('test', 'tbl_phones');
var fs2 = databaseManager.getFoundSet('test', 'tbl_phones');
if(fs1.find())
{
fs1.serial_no = _swap_serial_no;
fs1.unit_status = '100';
fs1.search();
if(fs1.getSize() > 0)
{
if(fs2.find())
{
fs2.serial_no = _original_serial_no;
fs2.search();
if(fs2.getSize() > 0)
{
fs1.customer_id = fs2.customer_id;
fs1.unit_status = '200';
fs2.swap_unit_id = fs1.unit_id;
fs2.customer_id = null;
_success = true;
}
}
}
}
if(_success)
{
// Some Functionalities
function1();
function2();
//Finally
application.output('Find Mode FS1 : ' + fs1.isInFind()); //Ref:1
application.output('Customer ID : ' + fs1.customer_id + ' Unit Status : ' + fs1.unit_status ); //Ref:2
_success = databaseManager.saveData();
application.output('Data Saved Successfully : ' + _success); //Ref:3
application.output('Customer ID : ' + fs1.customer_id + ' Unit Status : ' + fs1.unit_status ); //Ref:4
}
The problem is fs1 foundset is not saving. I like to mention here, this is happening only some times. Most of the times it saving correctly.
Further I have checked the fs1 foundset through output messages before saving (Ref:2) & after saving (Ref:4). All the times foundset has the correct values. However databaseManager.saveData() gives boolean value “true” (Ref:3).
And I have checked the foundset is in find mode or not by fs1.isInFind(). Always it give “false”.(Ref:1)
Now I’m stucked with this situation.
So Anyone could help me urgently, I’ll appreciate it.