Instead of looping through records, your script can:
a) Use Go to related records to change layouts to a layout based on the portal's table and pull up the set of records shown in the portal
b) constrain the found set specifying the "no" value
c) if get ( foundCount ) is greater than zero, delete all records
d) return to original layout
Works perfectly and very responsive. I have one quick question... Say I have like 20 different "Options"... Is there an easier approach besides creating 20 different scripts for each Radio button?
Use just one script and pass the relevant info that is different as a script parameter to your script.
That made things a lot easier, so I found a small issue with this method. If there are no related records made yet, it sorta bugs out and enters find mode on the existing layout.
Set error capture on to trap for error. Add script steps, something like;
If [ Get(lasterror)]
Show Custom Dialog [No related records]
If [IsEmpty ( RelatedTable::ForeignKey ) ]
Before the Go to Related Records step to check for the existence of related records.