If you but the button in the portal row, clicking that button can duplicate that specific portal row:
If [ Not IsEmpty ( PortalTable::_FkField ]--> check a field that always has a value for related records
Show Custom dialog ["duplicate this row?"]
IF [ Get ( LastMessageChoice ) = 1 // OK was clicked ]
Go To Related Record [Show only related records; From table: PortalTable ; Using layout: "PortalTable" (PortalTable) ]
Go to Layout [original layout]
The first If step is only needed if "allow creation...." is enabled for the portal.
Also be careful of script triggers that may interfere with this script when it changes back and forth between layouts. While Freeze Window will keep the layout change from being visible to the user, the change in layouts can trip quite a few different triggers on either of the two layouts. There are ways to set a value in a global variable to keep trigger performed scripts from doing anything in order to keep them from interfering.
The change in layouts will also cause a loss of the focus on a specific portal row. That is unlikely to be a problem here, but if it is, you can also capture the current portal row number in your script to use to reset the focus on that portal row by adding a few more steps to this script.
thankyou for your reply theres a few caviates in that solution and i don't want to disrupt other data acidently 8-/
I will try on a copy database file to make sure it doesn't cause issues first.
i am using filemaker pro10, do you know if the latest version has more functions in portals to simplify / strengthen this?
This seems pretty simple and secure to me. There are no new FileMaker 12 features that would change what I have recommended here.
that works a treat! thank you again 8-)