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.

problem looping through a portal

Featured Replies

I tried to write a script to loop through all of the items in a portal, setting a certain field based on the value in another field (the field I am setting is visible in the portal, the field I am testing is not visible in the portal, but it is accessible through the same relationship).

My first question is, how do I choose which portal I am working with when I use the portal navigation calls?

But, my real problem is in making a loop that runs through portal rows. The problem I have is in setting the field. The test that I have

if (relationship::field = value) always uses the value in the first row of the portal to set the subsequent rows. So the loop is working (it's setting all the rows) but the If condition is only using the first row field value.

how to I do I specify a the field of the current row to do the if test?

Thanks for any help.

-wald

This problem comes up regularly.

To make sure that you are in the correct portal, include a "Go to Field" script step that goes to a field that is only in the portal that you are concerned with. Then, go on from there.

As for looping through portal rows, you have to be careful that you don't perform a script step that causes you to jump out of the portal, or you will jump back to the first row. It's best to track the desired portal row in a global field so that you can use the "Go to Portal Row by field value" step so that you always know where you are.

I generally prefer to do my operations on related records by performing a subscript in the related file.

  • Author

I'm still having trouble.

It appears that the If test is always testing the first row, while the setfield call sets the correct row.

So, I'm looping fine, and I'm accessing the right row without a problem.

But why would the if test always test the first portal row?

By the way, in the if test, I use the relationship upon which the portal is based to access the field. Is there a way to test the portal field instead of the reltionship the portal is based on?

Thanks

-wald

Problem is that lots of functions will cause you to be out of the portal. Best bet would be to goto related records and perform this loop in the related file.

This is easier to manange and will cause you alot less headaches.

  • 3 weeks later...

quote:

Originally posted by wald:

[qb]I'm still having trouble.

It appears that the If test is always testing the first row, while the setfield call sets the correct row.

So, I'm looping fine, and I'm accessing the right row without a problem.

But why would the if test always test the first portal row?

By the way, in the if test, I use the relationship upon which the portal is based to access the field. Is there a way to test the portal field instead of the reltionship the portal is based on?

Thanks

Maybe this helps:

Cut and paste the content of the desired field in the portal to a global field and do the check on this global field .

Regards, Erik

/qb]

[ October 30, 2001: Message edited by: Erik H ]

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.