![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a script that creates a related record and fills in data using globa= l variables from the parent record. It seems that under certain conditions which remain a mystery, existing val= ues in the related file are overwritten by the new values.=20 Basically, the script begins by setting a global variable by concatenating = two strings. It then calls a script in a child record. The second script cr= eates a new record and sets the values of two fields based on the the globa= l variable from the parent file.=20 Again, I haven't been able to figure out exactly what conditions cause data= in the child file to be overwritten, but it almost seems like the new reco= rd isn't being selected. Is there a way to force FMP6 to select the new, bl= ank record? Would "Go To Last Record" guarantee that it would be selected?= =20 Here's the script, just in case you need more information. Thanks for any suggestions! Script 1: Enter Browse Mode[] Set Field ["GlobalVariable","primaryKey & childFile1:Notes"] Perform Script[Sub-scripts,External:"childFile2.fp5(*)"] The following script is performed from childFile2.fp5: New Record/Request Set Field ["relatedPrimaryKey","Left(parentFile::GlobalVariab le,5)"] Set Field ["notes","Right(parentFile::GlobalVariable)-5"] |
)
)
#3
| |||
| |||
|
|
Script 1: Enter Browse Mode[] Set Field ["GlobalVariable","primaryKey& childFile1:Notes"] Perform Script[Sub-scripts,External:"childFile2.fp5(*)"] The following script is performed from childFile2.fp5: New Record/Request Set Field ["relatedPrimaryKey","Left(parentFile::GlobalVariab le,5)"] Set Field ["notes","Right(parentFile::GlobalVariable)-5"] |
![]() |
| Thread Tools | |
| Display Modes | |
| |