View deleted records in xBrowse

View deleted records in xBrowse

Postby TimStone » Tue Dec 13, 2022 8:14 pm

For all of my application, I have SET DELETED ON so I do not display deleted records.

HOWEVER, in one program, I do want to use xBrowse to see ALL records.

Is there a flag for xBrowse that will allow me to view ALL records, including the deleted records, for just that file ?

I have tried the command line to SET DELETED OFF but that isn't working.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: View deleted records in xBrowse

Postby Marc Venken » Tue Dec 13, 2022 9:23 pm

Maybe if you would make or have a index on for deleted on that file you can use this :

Here : http://forums.fivetechsupport.com/viewtopic.php?f=3&t=38884&hilit=xbrowse+deleted&sid=a137e6519929be708f84654075ade8a8
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1439
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: View deleted records in xBrowse

Postby Antonio Linares » Tue Dec 13, 2022 9:27 pm

Dear Tim,

I just tested FWH\samples\fivedbu.prg and changed this line:

SET DELETED ON // OFF

and then I did this before creating the XBROWSE (look for XBROWSE inside fivedbu.prg):

SET DELETED OFF

and the deleted records are properly shown
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: View deleted records in xBrowse

Postby TimStone » Tue Dec 13, 2022 9:44 pm

Marc and Antonio,

Here is the problem. I have a File Editor built into my ( very large ) application. ( It is NOT FiveDBU though I do work with that. Mine is a full CLASS build and just for DBF at this time ).

In the Main() module, I use SET DELETED ON because my clients never want to see Deleted records.

However, in the Editor, it would be helpful to see them. IF I use SET DELETED OFF in the Editor, since it is MDI, it now applies that to anywhere in the full program, and DELETED records are suddenly visible.

Placing the SET command is the challenge. It would be easier if I had the ability to actually have it apply in the xBrowse ... but that may not be possible.

After looking at the source for the classes, and any documentation, I couldn't find any answer ..

Marc, thats a lot of overhead to do the indexing, and might not solve the problem anyway. Thanks for the idea ...

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: View deleted records in xBrowse

Postby nageswaragunupudi » Wed Dec 14, 2022 6:08 am

Though SET DELETED ON/OFF is a global setting effecting all WorkAreas, it is still possible to do what you want. There are several ways. I will be posting a few samples soon. Please wait.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: View deleted records in xBrowse

Postby Antonio Linares » Wed Dec 14, 2022 8:31 am

Dear Tim,

you could use the xbrowse container window bGotFocus and bLostFocus to SET DELETED ON and OFF
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: View deleted records in xBrowse

Postby TimStone » Thu Dec 15, 2022 10:25 pm

That didn't work ... at least with the ways I tried.

My TEMPORARY WORKAROUND is when I start the Editor, I SET DELETED OFF. Then, upon exit, using the VALID clause I can call a function to SET DELETED ON.

The main problem with this is it is still universal. So if they use the Editor, and don't end it, then SET DELETED OFF is still active, and every browse in the system will show the deleted records again.

What would be helpful is if we could isolate the deleted to the tDatabase class. For now, I will play with this to see if I can better protect it.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: View deleted records in xBrowse

Postby James Bott » Fri Dec 16, 2022 12:46 am

Tim,

It is possible to do INDEX ON ... FOR NOT DELETED

And you can create another index without that clause.

Then you can just switch indexes to get all records or only records not deleted.

I haven't tested this.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: View deleted records in xBrowse

Postby TimStone » Fri Dec 16, 2022 12:56 am

James,

My concern was my clients. I figured they wouldn't normally use this capability.

I resolved it by doing the following:

1) I left SET DELETED ON when starting the program
2) I put in a Menu item that calls a Function:

Code: Select all  Expand view  RUN

FUNCTION SelDelStatus

        IF MsgYesNo( "Do you wish to display deleted records ?" )
                SET DELETED OFF
        ELSE
                SET DELETED ON
        ENDIF

RETURN NIL
   
 


The ACTION statement refreshes the browse after running the function.

3) When exiting the editor, the program executes SET DELETED ON

With these steps I eliminated my concern. A client who uses the editor to simply make a change to raw data will not create any problems. Hopefully this will work.

There are already many indexes. I prefered not to go that route. The main reason for this capability is sometimes clients accidentally delete a record. When they call for help, I had to use a different program to recall the record. Now I can do it here, very easily.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests