Error Record has been update by another user [message #528612] |
Wed, 26 October 2011 01:42 |
|
glmjoy
Messages: 187 Registered: September 2011 Location: KR
|
Senior Member |
|
|
Its giving me Error
Invoice_Header.Remarks
I am getting this error Record has been update by another user. Re-query to see the change.
I have use table Invoice_Header
Invoice_No char(12);
Invoice_Date Date ;
Valid_From Date;
Amount number(13,2);
Remarks varchar2(100);
Date_Created Date;
Created_By Varchar2(50);
In Block Level I have used Following Triggers
PRE-INSERT
------------
:Invoice_Header.Date_Created := SysDate;
:Invoice_Header.Created_By := User;
------------
PRE-UPDATE
------------
:Invoice_Header.Date_Created := SysDate;
:Invoice_Header.Created_By := User;
------------
WHEN-NEW-RECORD-INSTANCE
-------------------
if User in ('JohnAC01') then
set_item_property ('Invoice_Header.Invoice_No_List', Enabled, Property_True);
else
set_item_property ('Invoice_Header.Invoice_No_List', Enabled, Property_False);
end if;
------------------
WHEN-VALIDATE-RECORD
----------------
Checking Validation of record.
---------------
When-Create-Record
Creating Record.
---------------
My Form is working properly but didnt know why that error raise.
Thanks in advance
|
|
|
Re: Error Record has been update by another user [message #528635 is a reply to message #528612] |
Wed, 26 October 2011 03:43 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
The error occurs when the contents of the record in the DB differ from what forms thinks it should be.
There are several ways this can happen.
The most common is because of database triggers.
If you have DB triggers on the table then you need to set the block property DML Return to yes.
|
|
|
|
Re: Error Record has been update by another user [message #528646 is a reply to message #528642] |
Wed, 26 October 2011 04:33 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
So the trigger doesn't modify Invoice_Header in any way?
If so you're going to have to work this out the hard way.
When forms queries a record (or when it inserts a record) it stores an image of the record as it currently is.
When it then tries to update the record it checks that image against the current values of the record in the DB.
If they differ in anyway you get that error.
So you need identify what is changing the record in the DB. Some possibilities:
1) Some else really is modifying the same record in another form (or the same form in another session).
2) Someone is using sqlplus or something else to modify it.
3) There's an actual update statement in the form that updates the record before forms does it itself.
4) There's an actual update statement in some stored procedure called from the form.
|
|
|
|
Re: Error Record has been update by another user [message #528699 is a reply to message #528676] |
Wed, 26 October 2011 08:15 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
How did you get from what I said to the code above?
Assigning values to block items post-insert (or post-update) is not a good idea and will cause other issues. Like forms asking the user if they want to save changes when, as far as the use is concerned, they haven't made any.
Why are you doing this?
|
|
|
|
|
|
Re: Error Record has been update by another user [message #528834 is a reply to message #528635] |
Thu, 27 October 2011 07:06 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Reposting the error message tells us nothing new. If you think that column is being changed from the value that was queried then you need to find the code that does it.
If it's a trigger on the table then I already told you the correct fix:
cookiemonster wrote on Wed, 26 October 2011 09:43
If you have DB triggers on the table then you need to set the block property DML Return to yes.
|
|
|