Home » Developer & Programmer » Forms » Synchronise field data (Forms 6i)
Synchronise field data [message #361579] Thu, 27 November 2008 01:03 Go to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello,

I have a master-detail relationship between two blocks. My master block fields are meant to be updatable. In the detail block, the same fields from the master block are repeated and completed with other additional counterparts. I want the recurrent fields in the detail block be populated and kept in sync with those of the master as user modifies either. For any new record in detail block, it's working fine : whenever I alter the value in the master block, any subsequently added record will show the fields with the new value but for the existing one I'm trying to trigger some synchronisation process. The recurrent fields in the detail block have the 'copy value from' property set to their counterparts in the master block but that seems not to be enough. Could someone please provide a programatic workaround?

regards,
Didz
Re: Synchronise field data [message #361626 is a reply to message #361579] Thu, 27 November 2008 03:41 Go to previous messageGo to next message
mikeverkimpe
Messages: 30
Registered: April 2007
Location: Belgium
Member
Try setting the property 'synchronize with item'. And set the detail item to synchronize with the master item.

Mike.
Re: Synchronise field data [message #361638 is a reply to message #361579] Thu, 27 November 2008 04:05 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Ah yes, I tried this. But the problem is that the 'synchronize with Item' Property is a combo box that only shows you the fields pertaining to the same block. My form splits 2 blocks in a master-detail relation unfortunately. Though, I have managed an arguably clumsy workaround : I have a 'Save' button on my form to commit the changes and whenever I do a save, well I loop through the whole detail block setting the 'sync' fields to whatever latest values their master block counterparts might be at that time before doing my little commit_form in the end. But I do believe that there's a more efficient way to implementing this.

Thanks anyway Razz


regards
Didz
Re: Synchronise field data [message #361738 is a reply to message #361638] Thu, 27 November 2008 18:49 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
This is a master-detail form. You are trying to update the record's "key" fields. You need to think of these fields as though they were 'primary key' fields.

When you update a 'primary key' field in the master use the 'on-update' trigger in the master block to create a NEW master record using the new key information, do a database 'update' of the subordinate records to the new key data, and then delete the 'old' key master record. You will need to go to the subordinate block and re-execute the query to show the newly updated records.

David
Previous Topic: Problem in the Webutil Configuration
Next Topic: FRM: 40508
Goto Forum:
  


Current Time: Thu Nov 14 05:02:38 CST 2024