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

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

Recommended Posts

Posted

I'm a newbie and I'm stuck AND feeling quite stupid.

I have a script that goes to a portal (of self-related records) on a layout, directly to Record#2. (Go to Portal Row [select; No dialog; 2]). The script then continues to loop through portal records and perform additional tasks. However, if record #2 doesn't exist (that is, there is only one related record), I want to abort the whole thing and generate an alert message. (If Record#2 doesn't exist, it indicates another problem that needs investigation.)

I thought I could just trap for an error, but it doesn't appear to generate an error if there is no second record. It just continues on, even though it hasn't been able to go to Portal Record 2. It apparently becomes caught in a loop as it continually retests a record that doesn't exist.

Questions: Is there any way to count the number of records in a portal? And/Or is there any other way to have it identify that there is no second record?

There's probably a really obvious answer out there...

Will be happy to provide more detail about this particular script, if needed!

Posted

Questions: Is there any way to count the number of records in a portal?

Try the Count() function.

Posted

A light bulb moment. ;-) Count the number of foreign keys.

This topic is 6348 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.