Re: Forms 4.5 :Record changed to old value
Date: 1997/12/03
Message-ID: <19971203014201.UAA23548_at_ladder02.news.aol.com>#1/1
>I have a record in a form which has a status different to QUERY( so CHANGED,
>NEW, INSERT) and I would like to come to the previous value without making a
>rollback. Is it possible?
>
>Thanks
>
>Natalia.
>
>
Hi Natalia
I'm not quite sure where a rollback comes into this. You are obviously only interested in changed records, new and insert can't have previous values.
Anyhow, check out this procedure, it may be what you want.
PROCEDURE requery_record IS
BEGIN
IF :system.record_status <> 'CHANGED' THEN -- If the record status is not
:system.message_level := 15; -- changed then validate it in
case
validate(item_scope); -- the user has changed the current :system.message_level := 0; -- item. Changes are not recognized END IF; -- until the item is exited. -- Suppress messages to prevent -- unwanted stuff like "field must -- be entered."
IF :system.record_status = 'CHANGED' THEN -- We are only concerned with changed
- records.
SELECT emp_id -- Select the database values into the ,last_name -- record using ROWID for the quickest ,first_name -- possible query. Note that you are ,middle_initial -- not restricted to the base table here INTO :emp.emp_id -- so you could include join(s) to get ,:emp.last_name -- any lookup values. ,:emp.first_name ,:emp.middle_initial FROM emp WHERE rowid = :emp.rowid; -- Finally set the record status to -- query_status so the form "thinks" -- it is part of the original query. Set_Record_property(:system.cursor_record,:system.cursor_block,STATUS,query_status);
END IF;
END; Regards
John
John C. Lennon
Utility Partners Inc.
4300 West Tropicana Blvd LVO-UPL
Las Vegas NV 89103
FOR UTILITY PARTNERS EMPLOYMENT
OPPORTUNITIES VISIT www.utilpart.com
e-mail: jomarlen_at_aol.com
Web Site: http://members.aol.com/jomarlen/
The views expressed in this message
are those of the author and not
necessarily those of U.P. Inc.
and/or its employees.
Received on Wed Dec 03 1997 - 00:00:00 CET