Home » Developer & Programmer » Forms » header data block is not saved when update in details block (forms 10g)
header data block is not saved when update in details block [message #689708] Thu, 28 March 2024 09:48 Go to next message
emadnabil
Messages: 179
Registered: August 2007
Senior Member
Dears

I have a strange behavior

I have a simple master details form

i am using pre-update trigger in the detail block to update value in the header block
here is the pre-update trigger
 :payment_flag := 'Y';
as payment_flag is in the header block

i traced it by putting messages in the trigger after setting the :payment_flag := 'Y';
and it normally changes its value to 'Y'
but when exit from the screen and return back to that record
I found it didn't apply the changes


why it didn't save it although by tracing the changes happens?
Thanks

Re: header data block is not saved when update in details block [message #689709 is a reply to message #689708] Thu, 28 March 2024 11:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68712
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

Any feedback in your previous topic?

Re: header data block is not saved when update in details block [message #689711 is a reply to message #689709] Sun, 31 March 2024 04:55 Go to previous messageGo to next message
emadnabil
Messages: 179
Registered: August 2007
Senior Member
Good morning
I replied on the previous topic
Many thanks
Re: header data block is not saved when update in details block [message #689712 is a reply to message #689711] Sun, 31 March 2024 17:03 Go to previous messageGo to next message
emadnabil
Messages: 179
Registered: August 2007
Senior Member
Kindly support
Re: header data block is not saved when update in details block [message #689720 is a reply to message #689712] Wed, 03 April 2024 05:24 Go to previous messageGo to next message
Littlefoot
Messages: 21822
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you COMMIT (i.e. push the "Save" button in toolbar) before exiting the form?
Re: header data block is not saved when update in details block [message #689721 is a reply to message #689720] Wed, 03 April 2024 05:46 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
I believe that you've got a timing issue.
When you press save forms processes each block in the order they are in the object navigator.
So it'll go through all the rows in the first block, see if there are any changes and if so apply them to the DB.
Then it'll do the same with the second block and so on.
Once it's done all the blocks it'll issue a commit.

So if you've got a pre-update trigger on the 2nd block that changes data in the 1st block that won't cause the change to the 1st block to be applied to the DB on that run of save processing.
However forms should know that the 1st block has changed. So if you press save a second time it should apply the change to the 1st block to the DB. And if you don't press save a second time and instead exit the form it should ask if you want to save changes.

Generally updating a master block from a child should be avoided. It causes all sorts of weird little problems due to the way forms work.
Re: header data block is not saved when update in details block [message #689736 is a reply to message #689720] Thu, 04 April 2024 04:23 Go to previous messageGo to next message
emadnabil
Messages: 179
Registered: August 2007
Senior Member
Did you COMMIT (i.e. push the "Save" button in toolbar) before exiting the form?
Yes and even so it applies the changes on the detailed block not the header
Re: header data block is not saved when update in details block [message #689737 is a reply to message #689721] Thu, 04 April 2024 04:29 Go to previous messageGo to next message
emadnabil
Messages: 179
Registered: August 2007
Senior Member
So if you've got a pre-update trigger on the 2nd block that changes data in the 1st block that won't cause the change to the 1st block to be applied to the DB on that run of save processing.
However forms should know that the 1st block has changed. So if you press save a second time it should apply the change to the 1st block to the DB. And if you don't press save a second time and instead exit the form it should ask if you want to save changes.
the second save i got
no changes to save
and also for sure when exiting the form it will not ask me to save changes

Re: header data block is not saved when update in details block [message #689742 is a reply to message #689737] Fri, 05 April 2024 03:49 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
Is payment_flag a database item? is the header a database block?
Re: header data block is not saved when update in details block [message #689743 is a reply to message #689742] Mon, 08 April 2024 05:22 Go to previous message
emadnabil
Messages: 179
Registered: August 2007
Senior Member
yes it is a database item
and the header is a databas block
Previous Topic: SELECTIVE INSERT INTO TABLE
Next Topic: pdf file saved in database
Goto Forum:
  


Current Time: Wed Nov 13 02:49:10 CST 2024