Reverting changes for invalid rows
On the form validation I can check the old value of a form row and compare it to the new value. However, I can't find a way to generically revert all changes on a row to their old values. This is what I'm trying, but I can't find the right function for line 9 that corrisponds with the getFieldNames and getFieldValue functions.
- found = false;
- for each val in input.SubForm {
- if(val.ID !=0){
- rw = Numbers[ID == val.ID];
- for each col in val.getFieldNames()
- {
- if(rw.getFieldValue(col) != val.getFieldValue(col)){
- found = true;
- val.set(col, rw.getFieldValue(col));
- }
- }
- }
- }
- if(found){
- alert "Some values have been reverted to their original values.";
- }