right above your if, set a variable capturing your portal row number. When your return, go to portal row will take a calculation of that variable to go to the correct row (as long as the data in the portal does not change).
OK- I am excited about this suggestion and feel like I am SO close to checking this one off- however, when I added these steps (I may have done something incorrectly...) upon execution I am prompted to choose which record I want to go to the portal variable on - it appears to be referencing the parent table number of records- not the child (portal) number of records.
(Record 4- would be the correct portal row)
Screen shots attached
There could be many things wrong.
Do you have portal scrolling enabled? It won't create a new record if the portal rows use up the portal space.
Does your relationship have "Allow creation of records via this relationship"?
I'd first investigate if it actually lands on the portal, goes to the last record and creates a new portal row.
Just first thoughts.
EDIT: Ah, I can see what it's about. Disregard my comment.
You probably need to specify which object (portal) to go to before using the go to portal row step.
You should use the Go To Object script step, with a parameter of the name of your portal (if you haven't given your portal a name, then do so).
Also, if you don't have advanced, you should upgrade. If you do have advanced, use the script debugger (under tools) to step through your script to see where it goes wrong.
And use the data viewer under tools while the script debugger is open to make sure your variables are capturing the right values.
I would use a different method to create the related record. Some call it Magic Key I call it 'Create Records without leaving home'...ok Magic key is cooler and much shorter but the end result is the same.
you can download a sample file that shows the technique here...
The basic idea is to have a global field in the parent table. Create a relationship, not the to be used for display, to the Child table connecting the global field and primary key of the child table. turn on allow creation of related records.
The script is simple
clear the global
set the foreign key in the child table with the parent ID in this case I guess it's ReportNumber
then set any additional fields
go to portal row last
Select "Perform without dialog" in the GoToPortalRow ( calculation ) and the message will disappear.
YES!!!! Thank You! Thank you! Worked great.
I do have advanced... I need to use that tool.
Thanks for this advice- I will definitely check it out.
ummm... Go To Portal Row does not have a "no dialog" option.
hmm, usually it's in the documentation but I didn't see it there. Good to know neither of us are crazy.
Yep, the very same logic with Go to record script step. "A classic"...
I does only when you select "calculation".