The easiest method is to capture the ID of the Contact with a script step Set Variable (near the top of the script steps). Give it a name, such as $contact_id, then specify the Contacts::__ContactsID_pk (for the field). Now you've got it, for that script, and you can create the new window, and go to the other layout. Then, after creating the new record, you can set the Participation::__ContactsID_fk field (if that's its name) with your $contact_id Variable.Set Variable is good way to move things. The only downside is that you have to type it correctly when you get there (hence I use simple names).
Thanks Fenton Jones, I'll give that a shot!
Hi there. I hate to admit, but I'm missing something, if you don't mind running me through each step...
I have included the set variable step in my script (see attached screenshot) to open an new window in the roles/participation layout. I probably didn't do this correctly already. If I did, then how exactly do I set the Roles::__ContactsID_fk (that's what it's called in my db instead of Participation) with my $contact_id variable?
So sorry that my questions are so VERY basic. I appreciate the help!
Put the Set variable step BEFORE the New Window step. Think of $CorrectID as a "bucket". you want to fill the bucket with an ID from the current contact record before you walk over to the Roles layout, create a new record and then dump the bucket into the appropriate field of the newly created Roles record.
And to "dump that bucket", you'll also need to add a set field step where you currently have a set variable step to set the correct field in Roles to the value of your variable.
When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.
Thanks, it worked! I had just noticed the "set variable" instead of "set field" mistake myself, but I would've never figured out how to specify correctly. Thanks again!