Focal Point
[SOLVED] Maintain:How to retireve Edited Deleted record

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6317038076

May 23, 2014, 08:18 AM
Nasar
[SOLVED] Maintain:How to retireve Edited Deleted record
Hi,
I am new to Webfocus.
I am developing a maintain application with UPDATE,DELETE and ADD functionality.
I want to enable the user to be able to retrieve and display the edited/deleted record.
Is there any feature available in maintain that helps us doing the same.
It would be very helpful if anyone can provide the pseudocode as well.

Thanks in Advance

This message has been edited. Last edited by: <Kathryn Henning>,


8.06
Windows
May 23, 2014, 12:17 PM
Alan B
I presume you mean during a Maintain session. This would be standard stack manipulation as discussed in the basic Maintain Training course. Please ensure that you undertake this course before developing an application in Maintain.


Alan.
WF 7.705/8.007
May 27, 2014, 04:32 AM
Nasar
quote:
the user to be able to retrieve and display the edited/deleted record

Thanks for the response.
Not really the maintain session. I am able to do that. I need to store both the new record and the edited record in the DB. Something like what the trigger does in SQL.
For example there is a row with values : 1,abc,234
The user edits that to: 1, xyz,234
So I would like to see both rows 1, xyz,234 and 1,abc,234 on the form as well as a seperate entry in the DB table.


8.06
Windows
May 27, 2014, 08:32 AM
Maintain Wizard
Maintain does not keep previous versions of the data in the database, unless you tell it to do so. Would you want to keep that last change to the record or all of the changes to the record? If you want to keep all the changes you can set up a CHANGE_DATE field and only INCLUDE records instead of updating. This will keep every iteration of the data.

If you only want to save the last change, you can create a LASTCHANGED field in the data and replace the data in that field every time you do an update on the form.

Those are pretty much your options.

Mark
May 28, 2014, 03:32 AM
Tewy
We never delete anything from a user entry system, too often the user will either make a mistake or try and manipulate the data and then lie about when they made the change. You need an audit trail to deal effectively with those situations.

We use a Data_Entry_Date, Current_Record_Version_Ind and Delete_Flag.

Every entry is inserted with a datetime stamp. If any records exist in the database (for the chosen key) the Current_Record_Version_Ind is set to 0 for those, and the new incoming record is set to 1. If they want to delete the record the Delete_Flag is set to 1 but the data remains in the table.

The data is then only made available through two views, one which is the entire history and one which is the current view and only contains records where Delete_Flag = 0 and Current_Record_Version_Ind = 1.

It works well for us.


WF 7.6.11
Output: HTML, PDF, Excel
May 28, 2014, 06:10 AM
Tony A
quote:
too often the user will either make a mistake or try and manipulate the data and then lie about when they made the change


Surely not? Razzer

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
May 29, 2014, 05:50 AM
Alan B
Tewy is correct in this being the approach to take. Maintain does not contain any features to automate this, but there is no reason that triggers could not be created on the table to achieve this type of transaction. These are outside the control of Maintain and can generally be set on the update, insert and delete actions to create the same scenario.

This can also be done easily in Maintain with include/update stacks and commit/rollback. Done once it becomes second nature to achieve.


Alan.
WF 7.705/8.007
May 29, 2014, 10:24 AM
George Patton
Tony A: LMFAO !! So it's not just my users who "forget" to tell me when they fick up.


Good One


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP