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.

Navigating Deep Portals

Featured Replies

Portal Navigation

Does anyone know of a good way to navigate through successive portals within the same file?

I have a file of parts. Each part can be made up of other parts, which in turn can be made up of still other parts. When a part is ordered, the number in inventory must be deducted for itself and for all its sub-parts and their sub-parts and so on, however many levels deep it goes.

The following wouldn't work, but if it would, it's what I'm trying to do:

Script: Deduct Items

code:


Set Field [ Qty_In_Stock, Qty_In_Stock - Qty_Ordered ]

If [ IsValid( Sub-Parts::Part_ID ]

Go to Portal Row [ First ]

Loop

Go to Related Record [ Sub-Parts ]

Perform Script [ Deduct Items ]

Go to Portal Row [ Next, Exit after last ]

End Loop

End If

This is a simplification, since acutally there is a line items file between the two and a global field is used to set up a temporary connection to the record in the local file.

The reason I think this doesn't seem to work is that each script doesn't seem to track which portal row it's on. So when I go to a different record and call the script again, when I return from the recursive call, I'm not in the portal row I was in to start with.

Any help would be much appreciated.

Thanks,

Chuck

Oooh! Looping scripts and poortails. I've seen cases that should work, but don't and a few that worked for years and quit for no reason. When I use a looping script and a portal I usually keep track of the portal row explicitly with globals for both the current portal row and the total number of portal rows (goto portal row by a number in the global field). This seems to be pretty reliable.

-bd

  • Author

Normally, I haven't had a problem with looping scripts in portals. It's the recursion in this case that seems to be the problem. The script needs to keep track of each portal row for each record, but it loses this when it goes to the related record to perform the same action on that record. I suppose I could try using globals, but how can I go to the related record, perform the same steps in that record, and return the the parent record, continuing down the portal? Possible a local field that stores the prior portal row number, keeping track of it for each record?

I liken what I need this to do to performing an operation with AppleScript on every item in a folder hierarchy. I perform the operation on the first item. If that item is a folder, I call the same routine, passing it the first item in the folder. AppleScript handles recursion well because each variable (such as the current item in a list) is kept when the recursive calls are made, but such is not the case with the script step Go to Portal Row. Perhaps the solution is to keep track of the portal row manually, but do so with a normal number field instead of a global field.

Any comments would be appreciated.

Thanks,

Chuck

The global approach will work, as long as you aren't jumping around between records and need to keep track of multiple current rows at one time. Using a real field will work also. If portals contents are record specific, this approach doesn't really have a downside.

-bd

  • Newbies

I don't kow if I have the answer to your question. I do have a page with two portals on it and the need to navigate through both of them, one at a time. One day, after a little cosmetic work in layout, the whole thing quit working right. The answer was to (re)arrange the two portals on different layers. i.e. send to back, bring to front etc. I had brought a sent to back portal to the front by mistake and calculations always seem to start in the back levels first. The number 2 portal was seeing the "go to portal row (last)" that should have been happening in the number 1 portal.

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.