Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6655 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have recreated a script which checks for a related record with the parent file. It suppose to then go to the related record, if found, and display it in the desired layout.

If not, I want a record created with the contactid from the related parent file posted to the contactid of the related file.

But the id is simply not being entered in the record. Is there a problem with my attached script?

wps_RestrictedContacts.pdf

Posted

Please don't use copy and paste to pass the primary key to the child table. It destroys the current contents of the clipboard and requires the target field for the copy and the paste step to be on the current layout. Instead, use a script parameter assigned at the button level or a script variable (available in 8) to pass the value from one table to the next and then Set Field to place the value into the foreign key field e.g Get(ScriptParameter) or $PrimaryKey. My preference is for the script parameter since it is compatible with FileMaker 7 and is more adaptive. In other words, you could assign a different primary key for each button that runs this script simply by changing the optional parameter at the button level. The only way to do this with a script variable is to write a conditional formula that will adapt only when you modify the condition. In other words, with some other dynamic programming (such as with the Go to Layout step) you could have a single script that creates child record no matter which parent table you start with.

This topic is 6655 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.