September 3, 201411 yr I would like to find out if it is possible to delete one record less than the found set / in this case my 'found set' records are identical- i have a need to delete all found records except one. Any suggestions? thanks
September 3, 201411 yr Technically, it's not possible to delete records en bloc except the entire found set. So, to delete all found records except one, start by omitting a single record. Then delete the remaining found set. If you open a new window first, then close it at the end, you will return to a found set of one in the original window.
September 3, 201411 yr Script: Loop Go to Record/Request/Page [Last] Exit Loop If [Get ( FoundCount ) = 1] Delete Record/Request [No dialog] End Loop When doing anything that deletes records, test on a copy first!
September 3, 201411 yr i have a need to delete all found records except one. However, you do not need to delete each record in the found set individually which takes more time because it must loop the records. Instead, and as Michael suggests, there is an easier, faster way: New Window [] Omit Record Delete All Records [ No dialog ] Close Window [ Current Window ] Michael, I would have thought that when returning to the original window, the omitted record would be included in the full record set and not isolated by itself, being the only remaining record in the original found set but I guess it makes perfect sense. This is very cool.
September 14, 201411 yr Author Thank you LaRetta, That is a good solution. Could I ask you how to make this apply to other request such as delete all but 2 records or delete all but 3 records, etc. That is just something I would like to know. This situation may come up for me. Thanks
September 14, 201411 yr Author Wow I experimented and figured it out for once. I just added another 'omit record' and it increased the number of NOT omitted records by 1 so I could do delete all records except 2 for example. Thanks for guiding me to discover this. Much appreciation.
September 14, 201411 yr Good morning! Just to be clear, it was Comment's idea. I only did it to see how it worked.
September 18, 201411 yr Author Thanks you both then. I appreciate it. It is so wonderful when something works.
Create an account or sign in to comment