I want to be able to set the number of new records (e.g. 8 new records) and for a loop script to create those records. Below is an example of how I would like it to look if I choose 8 rows. How would I do this? Thank you.
1. Name the portal.
2. Use this script to create $num_rows_to_create
Go to Object [ Object Name: "your portal name" ]
set variable [ $counter ; 0 ]
Set Variable [ $counter ; Value: $counter + 1 ]
Exit Loop If [ $counter > $num_rows_to_create ]
Thank you very much.
I know I am missing something here. On the first 'Set Variable' when I do it I can't see how to make it look like your version without the word 'Value'. Hope you can help.
Your idea of a loop is correct but New Record will not create a new record or line in the portal. It will create a new record in the table the layout is based on. First off you need a relationship that allows creation of new records, then in the loop go to the last portal row and use a Set field step to set the value of the Primary key from the parent record into the foreign key in the child record. This will create the blank row as long as the foreign key is not on the portal row.
Thank you and I understand most of what you said. I have added the Go to Portal Row to last and Set Field and the relationship is set up but I don't quite understand where you say 'Set field step to set the value of the Primary key from the parent record into the foreign key in the child record.' How would I do this?
You want to use the two field that your portal relationship is based on. The parent record is the record you are currently in and the child records are the records in the portal. Your set field is missing the calculated result. This should be the field on the parent side of the relationship.
Retrieving data ...