Home » Developer & Programmer » Forms » i cannot rollback
i cannot rollback [message #168247] Wed, 19 April 2006 08:01 Go to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

hii all

again iam so sorry for my several questions

i made a menu of these buttons
insert - delete - update - commit - cancel
when i press those buttons they work fine except 'cancel' button


the code for insert:
Quote:


if (vMenuItem = 'INSERT_pressed') then
LAST_RECORD;
CREATE_RECORD;
end if;





the code for delete:
Quote:


if (vMenuItem = 'DELETE_pressed') then
do_key('DELETE_RECORD');
end if;





the code for update:

Quote:


if (vMenuItem = 'update_pressed') then
do_key('EDIT_FIELD');
end if;





the code for commit:

Quote:


if (vMenuItem = 'commit_pressed') then
commit_form;
end if;




the code for cancel (cancel any changes i made):
Quote:


if (vMenuItem = 'cancel_pressed') then
rollback;
end if;






suppose i do the following:
1.press insert
2. insert record
3. press cancel

n.b i don't make commit
the ideal must remove what i inserted


my problem is that when i press 'cancel' it give me the form empty with no data (the form is cleared)


thanks for everyone helped and helping me
Re: i cannot rollback [message #168316 is a reply to message #168247] Wed, 19 April 2006 14:41 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm not sure will it help (or will it work at all), but - did you consider creating a savepoint (into the "Insert" trigger code) and rollback to it; perhaps this will do what you need.
Re: i cannot rollback [message #168374 is a reply to message #168247] Thu, 20 April 2006 02:16 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
How about doing a 'clear_block(no_validate)' followed by 'execute_query' to repopulate the block?

David
Previous Topic: ENTER PROCEDURE
Next Topic: How to save formula item in table
Goto Forum:
  


Current Time: Fri Sep 20 08:23:44 CDT 2024