tgs wrote:- Code: Select all
if (databaseManager.hasRecords(orders_to_orders_positions__uid_order)){
var vRec = orders_to_orders_positions__uid_order.getSize();
for ( var i = 0 ; i < vRec ; i++ ){
orders_to_orders_positions__uid_order.setSelectedIndex(i + 1);
forms.orders_pos_order_edit_dialog.m_count_amount_prices();
}
}
Hmm, not enough info to find a solution straight ahead, I'd need to see how the forms are related to each other but that is not the correct way of looping a foundset. Your code works only for foundsets up to 200 recs, when looping foundests you should always evaluate the size INSIDE the for loop, the reason for this is that Servoy fetches only 200 recs from the database, look at the following code:
- Code: Select all
if (databaseManager.hasRecords(orders_to_orders_positions__uid_order)){
for ( var i = 1 ; i <= orders_to_orders_positions__uid_order.getSize() ; i++ ){
var rec = orders_to_orders_positions__uid_order.getRecord(i)
...
...
}
This is the correct way of looping because Servoy will re-evaluate the orders_to_orders_positions__uid_order.getSize() at every iteration and when it reaches the 200th rec it will fetch another batch of 200 from the db.
Try to use this code in your method and see if things get better.