Home » Developer & Programmer » Forms » Updating too many records (forms 6i)
Updating too many records [message #412481] Thu, 09 July 2009 12:08 Go to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Help please,

I do not understand why this is occurring. I added a pre-update trigger to a datablock to insert updated_by and updated_date to the table when the record is updated. This works fine except when the user execute query to show all records and hits arrows to go through each record, if the user updates record 3, the updated columns are changed on record 1 and 2 as well. Any suggestions on how to update only the current record?
Re: Updating too many records [message #412667 is a reply to message #412481] Fri, 10 July 2009 08:03 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
Hello,

If PRE-UPDATE trigger fires on a record it's because the record has been changed. Check the code.
Re: Updating too many records [message #412668 is a reply to message #412667] Fri, 10 July 2009 08:28 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Hi,

Yes the record has been changed, but my problem is that it is updating all the records in the datablock not just the one record where the change was made. This is what I have in the pre-update trigger on the datablock:

BEGIN
:table.updated_by := :parameter.p_user_name;
:table.date_updated := sysdate;

END;
Re: Updating too many records [message #413268 is a reply to message #412668] Wed, 15 July 2009 01:15 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Then the form is UPDATING every record. Check the post-query trigger and verify that you are not setting/resetting an item.

David
Re: Updating too many records [message #413401 is a reply to message #413268] Wed, 15 July 2009 09:43 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Hello,

I actually removed the post-query trigger from the datablock. It is still doing the same thing. Through debug I can see it updating each record on the pre-update trigger. The following are the only triggers I have the the datablock.

pre-insert
when-validate-record
pre-update

I believe the error is coming from a field that has a post-text-item trigger. It starts off like this
IF :control.location_id is not null
and :system.record_status <> 'QUERY'THEN

[Updated on: Wed, 15 July 2009 10:06]

Report message to a moderator

Re: Updating too many records [message #413429 is a reply to message #412481] Wed, 15 July 2009 11:50 Go to previous message
cookiemonster
Messages: 12422
Registered: September 2008
Location: Rainy Manchester
Senior Member
If every record is being updated then some code in some trigger is causing every record to have it's status changed.
If your POST-TEXT-ITEM trigger only does anything if the record status is not QUERY then presumably it's a different trigger that's causing the problem.
If you can't find the trigger then you may have to resort to debugging the record status in every trigger you can find - one of them is changing it.
Previous Topic: Forms_ddl insertion problem
Next Topic: form not showing 'transaction complete: n records saved'
Goto Forum:
  


Current Time: Sun Dec 11 00:45:43 CST 2016

Total time taken to generate the page: 0.09894 seconds