Normal Topic Mass Delete in program (Read 334 times)
cbislander
Full Member
***
Offline



Posts: 132
Joined: Mar 22nd, 2018
Mass Delete in program
Feb 3rd, 2026 at 2:40pm
Print Post Print Post  
I have a database at each location that contains sold items that are not delivered.  The same databases are at the central location with all items delivered and not delivered.

Currently, the central location exports the non-delivered items to a text file where it can be imported by the remote locations.

Each time, I have do a Mass Delete before importing the files.  How can I do this automatically.

Here is the current program to import the text file:

#include "sbasic_include.sbas"

var vRun as Int
var vSpec as String
var vFile as String
var vDel as Int

//WarningLevel(0)

//DeleteRecord()

//WarningLevel(1)


vSpec = "ImportCases"
vFile = "V:\CLOUD\BACKUP\REMOTESOLDSR.txt"
vRun = @LoadImportSpec("SOLDIMPORT")
If vRun = 1
{
If FileExists(vFile)
{
RunImportSpec(vFile)
}}





  
Back to top
 
IP Logged
 
Ray the Reaper
YaBB Administrator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2506
Joined: Aug 20th, 2003
Re: Mass Delete in program
Reply #1 - Feb 3rd, 2026 at 2:51pm
Print Post Print Post  
Hello,

The following lines of code select Mass Delete from the Menu Tree

Code
Select All
Var vI as Int

If @Update
{
	vI = @SelectTreeItem("Search Update Menu!Results Commands!Mass Delete")
}

 



So you can place this before your code to do the Import.

Note: It will only delete the record(s) you have retrieved! So if you only retrieve 1 record out of 500 in your database, only that 1 will be deleted.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
cbislander
Full Member
***
Offline



Posts: 132
Joined: Mar 22nd, 2018
Re: Mass Delete in program
Reply #2 - Feb 3rd, 2026 at 2:57pm
Print Post Print Post  
Thanks Ray,  I'll get it a try.
  
Back to top
 
IP Logged