Using Xbrowse a lot, i'm thinking of the best way to register changes made in the xbrowse data.
A dbf with many fields is updated during the day and this for several fields. The changed data will be uploaded once a day true a API connection.
What do you do in this situation ?
I'm thinking of folowing
Make a changlog dbf where the changed data fields will be put in, and after API update clear this dbf
Name, olddata, newdata
adress, olddata, newdata
etc....
I can have Xbrowse do this for each field with the onchange , but then I have to code each field for this
My question : Can we subclass xbrowse for this to do automatic ? I never want a changed personel xbrowse for my projects because I want to keep all updates.
Maybe with a extra data: oBrw:logchanges -> Is true then log some fields
I never made a class, changed it or did any subclassing.
Subclass Xbrowse or changed data function
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Subclass Xbrowse or changed data function
Only one line of code
Instead of FWLOG, you can use your own write function
Code: Select all | Expand
oBrw:bOnChanges := <|oCol, uOldValue|
FWLOG oCol:oBrw:BookMark, oCol:cExpr, uOldValue, oCol:Value
return nil
>
Instead of FWLOG, you can use your own write function
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Otto
- Posts: 6412
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 27 times
- Been thanked: 2 times
- Contact:
Re: Subclass Xbrowse or changed data function
Dear Mr. Rao,
Isn't that a little unsafe?
The data is changed first, and then the old ones are backed up.
What happens if an error occurs?
Best regards,
Otto
Isn't that a little unsafe?
The data is changed first, and then the old ones are backed up.
What happens if an error occurs?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Subclass Xbrowse or changed data function
If an error occurs while saving data to the DBF, bOnChange also is not executed.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Otto
- Posts: 6412
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 27 times
- Been thanked: 2 times
- Contact:
Re: Subclass Xbrowse or changed data function
Dear Mr. Rao,
Therefore, I thought Mark should first save the old data before saving the new.
Best regards,
Otto
Therefore, I thought Mark should first save the old data before saving the new.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Subclass Xbrowse or changed data function
There is nothing special he has to do.
Just keep using XBrowse as it is.
Just keep using XBrowse as it is.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India