Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8430 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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...
Posted

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 ]

This topic is 8430 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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