I have the below javascript snippet, which is designed to batch save records. I have very limited experience with using javascript, so what I have built below is based on information I could find in the Skuid community and support tutorials.
Any help with this would be appreciated.
var $ = skuid.$, models = skuid.model.map(); // Define the source model & save model var sourceModel = models.VendorChecklistVerify; var saveModel = models.VendorChecklistSave; function batchsave(){ if (sourceModel.data.length > 10) { var increment = 1; $.each(sourceModel.getRows(), function(i,row){ if (increment < 11){ //duplicate this row in the Save Model saveModel.adoptRow(row); //remove this row from the source model sourceModel.abandonRow(row); //add to the increment var increment = increment+1; } else{ //save the "Save Model" and return to next batch saveModel.save(batchsave()); }//end of If statement from line 16 });//end of loop } else{ sourceModel.save(); }//end of if statement from line 10 }//end of batchsave function