Home » Developer & Programmer » Forms » Refresh Datablock... return to inserted record in block
Refresh Datablock... return to inserted record in block [message #80970] Thu, 19 December 2002 13:02 Go to next message
Tyler
Messages: 123
Registered: January 2002
Senior Member
Hello All...
I am doing an insert on a datablock, and then doing and EXECUTE_QUERY to do a refresh.. the problem is that there is a ton of records in the datablock and so after refresh (execute), I want the CURSOR_POSITION on the newly inserted record in the block so that the user can see that it was inserted... any suggestions?

Thanks,
T
Re: Refresh Datablock... return to inserted record in block [message #80973 is a reply to message #80970] Thu, 19 December 2002 19:47 Go to previous messageGo to next message
Evan Briggs
Messages: 12
Registered: November 2002
Junior Member
I've had that problem myself. The only work around that I could find is:
1) Go to the block.
2) Call the CREATE_RECORD bultin procedure.
3) Fill the fields in the block with the data to be inserted.
4) Then commit.

This will allow the entry of the record without having to execute the query afterwards. It will be entered after the current record at that time and ordered to the right position at the next query point. Some example code is below:

GO_ITEM ('DIVISIONS.DIVISION_ID');
IF (:DIVISIONS.DIVISION_ID = '' OR :DIVISIONS.DIVISION_ID = NULL) THEN
CREATE_RECORD;
:DIVISIONS.DIVISION_ID := :ORGANISATIONS.ORN_ID;
:DIVISIONS.NAME := :ORGANISATIONS.NAME;
COMMIT;
END IF;

Good Luck!!
Re: Refresh Datablock... return to inserted record in block [message #80979 is a reply to message #80973] Fri, 20 December 2002 10:52 Go to previous messageGo to next message
Tyler
Messages: 123
Registered: January 2002
Senior Member
Can't do that... the insert is an "indirect" one... The user pushes a button and it inserts a record... so they are not "keying in" data... so it won't be seen until refresh... any other suggestions ?

Thanx
T
Re: Refresh Datablock... return to inserted record in block [message #80988 is a reply to message #80973] Sun, 22 December 2002 19:04 Go to previous message
Evan Briggs
Messages: 12
Registered: November 2002
Junior Member
If you have a closer look at the code in my previous reply, you will see that it will work. The information is assigned to the fields through the PL/SQL code. Therefore you can set them to whatever you want at run time.

Good luck, Merry Chistmas.
Previous Topic: Insert, delete, update
Next Topic: how to code the update button in a form
Goto Forum:
  


Current Time: Sun Jun 02 09:28:19 CDT 2024