Duplicating a portal row/record in Filemaker

I want a script that takes me to a portal row and then duplicates the portal row. The navigation part of the script which takes me to the selected row works fine. With the cursor blinking at me in the correct row, on implementing Duplicate Record from the menu (to test the action), all records disappear from view in the portal and all other portals on the tab control go blank as well. The cursor ends up on the main record.

Having selected the portal row I cannot understand why this should happen. Can anyone advise me as to why this should happen and not simply reproduce the record?

Incidentally, no duplicate record shows up in the underlying table.  
c0linkAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
webwyzsystemsConnect With a Mentor Commented:
When you duplicate like this, you are duplicating the RECORD LINKING TO THE PORTAL, not the record in the portal row itself. When you dupe the record, for some reason the relationship key for all the portals is lost.

You are almost there though.

Just do a freeze window, go to related record(show in the appropriate layout for the child table), duplicate record, then return to original layout. Your new record should appear in the portal.
Finally, you might have to go to portal row last or first...not sure how you sort.
There are other ways, but thats probably the simplest.
0
 
lesouefCommented:
duplicating a record duplicates the current record of the current table on which the current layout is based, even if you are currently selecting a portal row.

to duplicate a related record, there are several ways, the simplest is:
(from the portal raw)
goto related record, using the related table layout
duplicate record
goto layout (original)
0
 
c0linkAuthor Commented:
Simple is very good.
Now I know the flow it works well. Also explains why the blanks. It was because by trying to duplicate the linked record it could not recreate a unique value field, hence it blanked.

Freeze window is another useful tip to remember.

Thanks a lot.
0
 
c0linkAuthor Commented:
Received this after another solution (same) presented. Understanding what was actually being duplicated explained everything.

Thanks for your feedback.
0
 
lesouefCommented:
I had not seen the 1st solution, it's been posted while I was typing mine... EE needs ajax!
just a remark about: "for some reason the relationship key for all the portals is lost."
makes sense, when you duplicate the current record, the ID is changed, so related records are not the same for the dupped record.
0
All Courses

From novice to tech pro — start learning today.