Home » Developer & Programmer » Forms » Error Record has been update by another user (Form 6i )
Error Record has been update by another user [message #528612] Wed, 26 October 2011 01:42 Go to next message
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 Go to previous messageGo to next message
cookiemonster
Messages: 13931
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 #528642 is a reply to message #528635] Wed, 26 October 2011 04:24 Go to previous messageGo to next message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
Yes I have done DML property to yes.

Thanks

[Updated on: Wed, 26 October 2011 04:30]

Report message to a moderator

Re: Error Record has been update by another user [message #528646 is a reply to message #528642] Wed, 26 October 2011 04:33 Go to previous messageGo to next message
cookiemonster
Messages: 13931
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 #528676 is a reply to message #528646] Wed, 26 October 2011 06:30 Go to previous messageGo to next message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
Thanks Cookie for your valuable information I have resolved that because of your output. I have taken trigger and assign that value in that.

POST-INSERT

Select Remarks into :INVOICE_HEADER.Remarks from Rent_Invoice_Header
Where rowId=RENT_INVOICE_HEADER.RowId;

It works for me.

[Updated on: Wed, 26 October 2011 06:32]

Report message to a moderator

Re: Error Record has been update by another user [message #528699 is a reply to message #528676] Wed, 26 October 2011 08:15 Go to previous messageGo to next message
cookiemonster
Messages: 13931
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 #528813 is a reply to message #528699] Thu, 27 October 2011 05:11 Go to previous messageGo to next message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
You Wrote that
"The error occurs when the contents of the record in the DB differ from what forms thinks it should be."

So I look closely the error and it says on remarks. So I put post insert trigger to make DB record and Form record equal.

The reason to stop that error.
Please guide which will be the proper way to do that.

Re: Error Record has been update by another user [message #528814 is a reply to message #528813] Thu, 27 October 2011 05:20 Go to previous messageGo to next message
cookiemonster
Messages: 13931
Registered: September 2008
Location: Rainy Manchester
Senior Member
You need to explain why they differ in the first place.
Re: Error Record has been update by another user [message #528826 is a reply to message #528814] Thu, 27 October 2011 06:33 Go to previous messageGo to next message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
Record has been update by another user. Re-query to see the change.

I didnt know exactly but as your good helpful opinions I discover that I have DB trigger In which Insertion and Updation performing may be it occurs when users updating the remarks field in Form Level. Thats my thinking.
Re: Error Record has been update by another user [message #528834 is a reply to message #528635] Thu, 27 October 2011 07:06 Go to previous message
cookiemonster
Messages: 13931
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.

Previous Topic: error 404 when running a form in 11g
Next Topic: message built in
Goto Forum:
  


Current Time: Sun Aug 11 09:47:16 CDT 2024