July 9, 200718 yr 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!
July 9, 200718 yr Questions: Is there any way to count the number of records in a portal? Try the Count() function.
July 9, 200718 yr Author I looked at Count... but it seems to count the number of values in a field? Is there a way to make it count records in a portal?
July 9, 200718 yr Author Hold it. I think I just got it. Lemme try Count, if I think I understand...!
Create an account or sign in to comment