Hi,
If somebody know how to retrieve actual record Index from foundset. I have table with 35000 records and I need to move cursor on the specific record w/o removing other records.User search records by Name. Here my code:
if (controller.find())
{
forms.custsearch.foundset.find();
name = "#%" + 'SERVOY' + "%";
var count = forms.custsearch.foundset.search();
var rec = foundset.getRecord(foundset.getSelectedIndex()) // the search retrieve only on record
controller.loadAllRecords(); // populate table view again
var curForm1 = controller.getName();
var fs2 =forms[curForm1].foundset; // create second foundset
fs2.getRecord(rec.customerid); // take record by primary key. Here a problem ,because some records can be deleted and I can stay on wrong page of records
var index = fs2.getRecordIndex(rec); // find actual record index in foundset
foundset.setSelectedIndex(index); // move cursor in main foundset and show in table view
}
This code works,but the problem is in last 3 lines. If i have big gap(more than 200 records) between actual rowindex and primary key(for example user delete records) the page never refresh and cursor doesnot moved. In last 3 lines of code I take record by customerid # ,which is PK. This procedure refresh my foundset and load other portion of 200 records in memory. After, I try to find actual Record index and move cursor in my Table View.
It will be nice if record which I retrieve using a search function contain actual rowindex from my foundset. I can make loop and populate new portions of foundset , but it take time. May be somebody know other solution.