Home » Developer & Programmer » Forms » How to update records in second window/blocks from base blocks (Oracle forms 10g)
How to update records in second window/blocks from base blocks [message #413399] Wed, 15 July 2009 09:30 Go to next message
ryansl
Messages: 2
Registered: April 2009
Location: halifax
Junior Member
Hello,

I have created a form with multiple blocks. The first set of 3 blocks are viewed on a base window and are related. They are shown in tabular form. I have a second window that is made up from the same 3 blocks but show only 1 record in a second modal window (form style). The user should be able to click on a add or edit button on the base window and this will bring up the modal windown showing the record. I've created a procedure to populate the modal window on an edit (ex. base_table.id :=base_table1.id). When I do this it sets the record status to insert and when I try to update the record and save based on a procedure that I've written I cannot because the record status is incorrect. Is there a way that I can query the base tables to show the correct row in the modal tables window or change the record status when trying to update? I've tried changing the status after populating the fields in the modal window for an update but still get an error message, and the status has changed back to insert.

Thanks in advance,

slr
Re: How to update records in second window/blocks from base blocks [message #413539 is a reply to message #413399] Thu, 16 July 2009 05:30 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
Form builder can only ever update records that have been queried. If you populate the block manually then those records will count as new records and will be inserted. Messing around with record status will not override that.

So what you need to do is stop using a procedure to populate the block and query the records instead using an appropriate where clause.
Re: How to update records in second window/blocks from base blocks [message #413604 is a reply to message #413399] Thu, 16 July 2009 12:20 Go to previous messageGo to next message
ryansl
Messages: 2
Registered: April 2009
Location: halifax
Junior Member
Hello,

I did manage to get that working. I deleted some on-insert and on-update triggers that I had there previously and the query worked. I created a procedure to insert or update the 3 tables concerned and am now getting resources busy, unable to reserve record and invalid user.table.column...I'll update this post if I can't work things out. I did include an on-lock trigger on each block. I think the tables are being locked by other users.

Thanks,

slr
Re: How to update records in second window/blocks from base blocks [message #414418 is a reply to message #413604] Wed, 22 July 2009 01:40 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
No. Your other block is probably locking them.

Do as 'cookiemonster' recommended "stop using a procedure to populate the block and query the records instead using an appropriate where clause".

Start your form again. Keep it as simple as possible. Do not create any triggers except those created automatically by the master/detail wizard. Get the basic processing working and THEN add any extra code that is needed.

David
Previous Topic: Not to clear the record after delete
Next Topic: how to get display value of selected list item
Goto Forum:
  


Current Time: Mon Feb 10 04:29:13 CST 2025