Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Walk thru all database table records until match is found then delete

$
0
0

I have a database connected form. It has a scipt that checks to see if that forms data has already been submitted by searching thru the records for the formID number. I want the records to be deleted if found and then add new records incase the form data has been changed. I can make this work once by using the script below. Is there a short way to make it continue searching and deleting all the records that start with that form ID number instead having to copy this script 12 times (maximum number of records allowed).

var oFile = Subform1.FileName.formattedValue;
var bFound = false;
while(!oDB.isEOF()){
 if(xfa.record.DataConnection2.FileName.value == oFile){
 bFound = true;
 break;
 }
 oDB.next();
}
if(bFound){ 
 oDB.delete();
 oDB.update();
}

Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>