So I just want to make sure I understand the different ways to create related records from a script.
1. I could use a layout that has a portal object, and then Go To Portal Row last and set the fields. The Foreign Key will automatically be set this way.
2. For just a single child record, I could Set Field as long as I'm currently on the parent layout with an active parent record? This will create a child record. I assume the Foreign Key will automatically be set this way.
3. I could use the Magic Key method which lets me use Set Field and no layout for multiple child records. My understanding is
a) I create a relationship that matches a global field on the parent to the primary key of the child.
b) I make sure the global field is blank.
c) I use Set Field on the child which creates a new child record and puts the child primary key into the global field. I still have to set the values of the child including the foreign key to be the parent.
4. I could use a layout for the child table and set fields from variables, but I have to make sure to set the foreign key to be the parent primary key.
5. If a child record already exists, I could use Go To Related Records and then do a New Record Request for each additional child record I want to create. The Foreign Key will automatically be set this way.
Do I have this right?