Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dublicate portal script step.

Featured Replies

I need help on this script. I have a layout with 3 different portal tables and the script should make a duplicate record and also duplicate the 3 portal tables. The script works fine with one table but it wont Loop/repeat the other 2, whats wrong with the script?

Thanks

#

#

#

Set Variable [ $OrigWindowName; Value:Get ( WindowName ) ]

Go to Related Record [ From table: “oil_quantities”; Using layout: “oil_quantities” (oil_quantities) ]

[ Show only related records; New window ]

Select Window [ Name: $OrigWindowName ]

Duplicate Record/Request

Set Variable [ $NewRecipeID; Value:recipes::recipe_id ]

Select Window [ Name: "OilDupes" ]

#

#

# Duplicate Oils

Go to Record/Request/Page

[ Last ]

Loop

Duplicate Record/Request

Set Field [ oil_quantities::recipe_id; $NewRecipeID ]

Omit Record

Omit Record

Exit Loop If [ Get ( FoundCount ) = 0 ]

End Loop

# Duplicate adds

Go to Record/Request/Page

[ Last ]

Loop

Duplicate Record/Request

Set Field [ add_quantities::recipe_id; $NewRecipeID ]

Omit Record

Omit Record

Exit Loop If [ Get ( FoundCount ) = 0 ]

End Loop

# Duplicate EOs

Go to Record/Request/Page

[ Last ]

Loop

Duplicate Record/Request

Set Field [ eo_quantities::recipe_id; $NewRecipeID ]

Omit Record

Omit Record

Exit Loop If [ Get ( FoundCount ) = 0 ]

End Loop

Close Window [ Current Window ]

Commit Records/Requests

[ Skip data entry validation; No dialog ]

#

#

# Duplicate Oils

Go to Record/Request/Page

[ Last ]

Loop

Duplicate Record/Request

Set Field [ oil_quantities::recipe_id; $NewRecipeID ]

Omit Record

Omit Record

Exit Loop If [ Get ( FoundCount ) = 0 ]

End Loop

[color:red]

>>>>>>

# Duplicate adds

Go to Record/Request/Page

[ Last ]

Loop

Duplicate Record/Request

Set Field [ add_quantities::recipe_id; $NewRecipeID ]

Omit Record

Omit Record

Exit Loop If [ Get ( FoundCount ) = 0 ]

End Loop

After duping the first set of records, you're left with no found records and you start your next loop.

Running this with the Script Debugger on should should you this issue.

tmas,

Have you considered a scripted import instead of fussing with loops?

GTRR: primary--> childrenPortal1

Spawn a new CHILD window. Import.

Close Window

Back to original screen

GTRR: primary --> childPortal2

etc...

Often much faster than looping scripts for the creation of new records.

If you need to set some values, loop through the found set after the import.

Good luck!

*susan*

  • Author

So should I repeat the whole top script step? Like this? Sorry but I dont understand the way it repeats.

Set Variable [ $OrigWindowName; Value:Get ( WindowName ) ]

Go to Related Record [ From table: “oil_quantities”; Using layout: “oil_quantities” (oil_quantities) ]

[ Show only related records; New window ]

Select Window [ Name: $OrigWindowName ]

Duplicate Record/Request

Set Variable [ $NewRecipeID; Value:recipes::recipe_id ]

Select Window [ Name: "OilDupes" ]

# Duplicate Oils

Go to Record/Request/Page [ Last ]

Loop

Duplicate Record/Request

Set Field [ oil_quantities::recipe_id; $NewRecipeID ]

Omit Record

Omit Record

Exit Loop If [ Get ( FoundCount ) = 0 ]

End Loop

Set Variable [ $OrigWindowName; Value:Get ( WindowName ) ]

Go to Related Record [ From table: “eo_quantities”; Using layout: “eo_quantities” (eo_quantities) ]

[ Show only related records; New window ]

Select Window [ Name: $OrigWindowName ]

Duplicate Record/Request

Set Variable [ $NewRecipeID; Value:recipes::recipe_id ]

Select Window [ Name: "EoDupes" ]

# Duplicate EOs

Go to Record/Request/Page [ Last ]

Loop

Duplicate Record/Request

Set Field [ eo_quantities::recipe_id; $NewRecipeID ]

Omit Record

Omit Record

Exit Loop If [ Get ( FoundCount ) = 0 ]

End Loop

  • Author

Interesting what does GTRR: mean?

Go To Related Record. Sorry, that is my own mental shortcut.

*susan*

  • Author

Something like this? But how does it know to import this record?

Go to Related Record [ From table: “oil_materials”; Using layout: “oil_detail” (oil_materials) ]

[ Show only related records; New window ]

Import Records [ ]

[ No dialog ]

Close Window [ Current Window ]

Go to Layout [ “recipes” (recipes) ]

You will need a "shadow table".... I will create a demo file for you. Much easier than describing the process.

Duplicating this way only makes sense if the routine is going to be used more than once, i.e. a regular part of the workflow.

*susan*

  • Author

Its basically just for the user to duplicate a existing record incl. its portal entries.

Got a call from a client... sorry to take so long to create the demo file. This is the general jist though. Think about how to preserve the found set before starting the routine, so that you can return the user to a logical point.

Hope this helps!

*susan*

DuplicateWithImport.fp7.zip

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.