If you display your records in portals with the allow creation of records via this relationship option enabled, you can create a new related record simply by entering data in the bottom blank row of the portal.
Scripts to create records in related tables generally follow this pattern:
Set Variable [$ID ; //select primary key field of parent record]
go To Layout [//specify layout to related child table]
Set Field [ Childtable::foreignkeyfield ; $ID ]
Go To Layout [original layout]
You'll have to substitute your fields for the ones I used in the example.
Sorry for the delay of my response.
Well, I did what you said adjusting the script to my own fields. It worked and I wanted to thank you!
Just a small notice, I replaced the last line of your script with this one "Go To Layout [Cycle Deails]", because I wanted to create a record in a different layout, just in case someone else tries it.