how to synchronize master and detail records [message #663916] |
Mon, 26 June 2017 00:44 |
|
DoodsGavion
Messages: 3 Registered: June 2017
|
Junior Member |
|
|
Good afternoon. I need to synchronize master and detail records. i have a master-detail form and i need to update an item in the detail based on the value of the item in the master.
In the detail block, i added a when-validate-item trigger (:fm_dvs_personnel_dt.dt_fund := :fm_dvs_personnel_ms.budget_fund)
In the master block, i added a key-commit trigger(synchronize;commit_form;)
When i changed the value of the item in master, only the first record of the detail is updated (a master record can have one or more detail records).
Thanks in advance.
|
|
|
Re: how to synchronize master and detail records [message #663919 is a reply to message #663916] |
Mon, 26 June 2017 02:52 |
cookiemonster
Messages: 13943 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you want to update multiple detail records then you would need to go to the detail block, loop through the records and the block and set each one in turn.
You can't do that from WVI.
The fact that you're doing this does suggest your tables aren't in third normal form and probably should be.
|
|
|
Re: how to synchronize master and detail records [message #663920 is a reply to message #663916] |
Mon, 26 June 2017 02:57 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
That looks like redundancy (keeping the same value in both master and detail block (presumably, tables as well)). If that's so, data model isn't correct (hint: 3rd normal form). Consider re-modelling it; as a side-effect, a Forms problem you currently have won't exist any more.
[EDIT] Ah; CM posted his message while I was writing mine. Anyway, now you have two opinions that match, so ...
[Updated on: Mon, 26 June 2017 02:59] Report message to a moderator
|
|
|