Question 2 first.
I don't understand the tab control box w/ portal, and goes back to the first person. Are you saying the portal resets to the first record in the portal, or the Main record you were on goes to the first Main record?
What I would do is open the detail layout in a new modal window. After thoroughly testing, I would remove all navigation on this layout and add a close window button, that just closes the window. Then after you are done editing on the detail layout, closing this window puts you back where you started........if I understand your question correctly.
This would require a script with a loop.........and testing on a copy of the database.
Assuming the report is basically a find of all the people who turned in 'the form'. Do this find on the layout that contains each form. Then basically
Go to Record [First] //usually this isn't required after a find because it puts you on the first record
Set Field [YourTable::YearField; Year ( Get ( CurrentDate ) )
Set Field [the one you want to put a 'Y" into]
Hide Record (I think this is needed, to prevent from duplicating the duplicate. It may invoke a commit records dialog, which can be suppressed with starting the script with Set Error Capture script step)
Go to Record [Next;exit after last]
But test on a sample DB first
In an unsorted found set, duplicate record creates a new record at the end of your found set. This becomes your current record so Go to record [next ; exit after last] won't work.
Instead, do it this way:
Exit Loop If [ Not Get ( FoundCount ) ]
Go to Record/request/page [first]
This leaves you with a blank layout due to a found set of zero records. But you can then perform a find for all records with the data you just entered via the set field step to pull up just the list of newly created records.
I will try your method in response to my original question on the duplication issue.
To answer your question about the portal, I have a screen shot of the main screen and then a screen shot of the detail screen which is accessed by pressing the button on the portal row. When I close the detail screen, it takes me back to record number 1 of the database rather than the record that the portal I was on. In the screen shot, I am showing you record #9. When I close the detail screen, it takes me to record #1.
So I have not heard from anyone on my dilemma regarding the button and explanation above.
There are multiple possibilities. Best guess is that one of the several layout changes is tripping a script trigger that performs a script taking you back to the first record of the layout's found set.
On Layout Enter, OnLayoutExit, OnRecordLoad, OnObjectEnter are just a few of the triggers that a change in layouts can trip.
But if your return button performs a script, that scipt could also contain code that changes records.
If you have FileMaker Advanced, enable the script debugger just before clicking return and then step through any script that appears in the debugger. If a script trigger is being tripped, you'll see it's script pop up in the debugger.
So, if I do have a script that takes me to first record and I want to add code to the button to get me to a particular record, what is the code?
The code is to not run the script that takes you to the first record when this button is clicked. Go To Layout should be all that is needed to return both to the layout and your current record on that layout. But is some script is run, either from the button click or one of the layout changes that changes the current record, you'll need to take steps to prevent that code from being executed.