The below form calc script stops after first iteration.
Following lines not perform: // Uncheck the checkbox of the inserted row // Update row count after insertion // Skip to the next row after insertion
Following lines not perform: // Uncheck the checkbox of the inserted row // Update row count after insertion // Skip to the next row after insertion
form1.Button.Button8::click - (FormCalc, client)
var rowCount = Table1.Row1.instanceManager.count;
var i = 0;
while (i < rowCount) do
if (Table1.Row1[i].Subform01.CheckBox1.rawValue == 1) then
// Insert a new row after the checked row
var newRow = Table1.Row1.instanceManager.insertInstance(i + 1);
// Copy values from the checked row to the new row
newRow.Subform02.Text01.rawValue = Table1.Row1[i].Subform02.Text01.rawValue;
newRow.Subform02.Text02.rawValue = Table1.Row1[i].Subform02.Text02.rawValue;
newRow.Subform02.Image01.rawValue = Table1.Row1[i].Subform02.Image01.rawValue;
newRow.Quantity.rawValue = Table1.Row1[i].Quantity.rawValue;
newRow.Unit.rawValue = Table1.Row1[i].Unit.rawValue;
newRow.UnitPrice.rawValue = Table1.Row1[i].UnitPrice.rawValue;
newRow.TotalPrice.rawValue = Table1.Row1[i].TotalPrice.rawValue;
// Uncheck the checkbox of the inserted row
Table1.Row1[i].Subform01.CheckBox1.rawValue = 0;
// Update row count after insertion
rowCount = rowCount + 1;
i = i + 1; // Skip to the next row after insertion
else
i = i + 1;
endif
endwhile