AnsweredAssumed Answered

Changing primary (parent) key does not change foreign (child) keys

Question asked by DanielNichols on Jan 4, 2013
Latest reply on Jan 7, 2013 by philmodjunk


Changing primary (parent) key does not change foreign (child) keys


     Here is my table relationship diagram:

Primary key - foreign key relationship

     I thought changing Part::Part Name would automatically update all the child Drawings.  Instead, the portal in my Part layout is cleared, and all of those Drawing records are left dangling.

     As far as I can tell, I need to create a script triggered when I enter the Part::Part Name field which saves the current value to a global variable ($$PartName).  Then, after the field has been changed, another script triggered on exit will find all the child records where Drawing::Part Name = $$PartName and set them to Part::Part Name.

     I've been butting my head up against this issue for several hours now, so any help would really be appreciated.