Updating values in a details block [message #142151] |
Thu, 13 October 2005 11:02 |
ducrot
Messages: 3 Registered: October 2005
|
Junior Member |
|
|
Hi,
First, excuse my poor english.
I work with Forms 5.
I have a form with a master block and a details blocks.
In the details block, the values of some fields are obtained by calculation using the value of a field, say F, in the master block. All works fine.
But, I don't know how to update the calculated values of all the records of the details block when I modify the value of F in the master block. In the When-validate-item trigger associated to F, it's impossible to use a GO_BLOCK(details block) and it seems impossible to execute the on-populate-details trigger because that trigger calls GO_BLOCK.
Thank you by advance to people who can help me.
Ducrot
|
|
|
Re: Updating values in a details block [message #142190 is a reply to message #142151] |
Thu, 13 October 2005 13:11 |
feroze
Messages: 144 Registered: September 2005 Location: chicago
|
Senior Member |
|
|
Hi
Your calculated fields in detail block is it non database item.
Use formula in detail block item properties either write a trigger on post_text_item of F field in master block to do a calculation or else in the properties of details field write the formula.
Yes GO_BLOCK is restricted in when_validate_item trigger.
Let us know how it works
Regards
|
|
|
Re: Updating values in a details block [message #142196 is a reply to message #142190] |
Thu, 13 October 2005 13:46 |
ducrot
Messages: 3 Registered: October 2005
|
Junior Member |
|
|
Hi feroze,
Thank you for your answer. Unfortunately, it doesn't work.
My calculated fields in details block are database items.
If I put a calculation in the when_validate_field (or post-text-item) of F field in the master block that affects a details block field, the result of the calculation appears only in the first record of the details field.
It's why I tried (without success) to use on-populate-details trigger.
When you propose to "use formula in detail block item properties" or "in the properties of details field", I don't understand where I ought to write the formula.
GO_BLOCK is also restricted in post_text_item trigger.
Ducrot
|
|
|
Re: Updating values in a details block [message #142200 is a reply to message #142196] |
Thu, 13 October 2005 13:57 |
feroze
Messages: 144 Registered: September 2005 Location: chicago
|
Senior Member |
|
|
Hi
Sorry it didn't work,Thing is i don't have forms and reports installed so couldn't check it,Just assuming and trying to help out.
Why you are getting the result only in first record of detail block you should get in all the detail records,try to bring the cursor in detail block and see all the records .
where did you put the calculation formula in detail or master block field,
or else write the trigger when_new_item_instance in detail block level and write your formula in that trigger :detail_block.field := :master F + something + ..
After the last field in master block write trigger
key_next_time go_item(:detail_block.field name)..
Let's try like this..
|
|
|
|
Re: Updating values in a details block [message #142412 is a reply to message #142233] |
Fri, 14 October 2005 08:43 |
ducrot
Messages: 3 Registered: October 2005
|
Junior Member |
|
|
Hi gang,
Finally, I have found a solution inspired by your answer and by feroze's one.
I have developped a key-next-field (and key-previous-field) trigger associated with the master block F field. In that trigger, if the value of F has changed, I goes to the details block, makes the calculation for every records in a loop, goes up to the first record and returned to the master block.
Thank you for having taken time to answer to to my problem
Ducrot
|
|
|