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

script logic - check multiple things with custom dialogs and omit if any true?


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

Recommended Posts

Posted

I've actually been struggling with this for a couple days and can't seem to pinpoint the logic:

I have a set of records. There is a related portal on the layout. I go to the first record via Go To Record/Request/Page First.

Start a loop.

If a certain field is empty,

Custom Dialog 1 (shows the user the record ID number and a message specifying the problem). Then...

If the count of the number of records in the portal is <2,

Custom Dialog 2 (shows the user the record ID number and a message specifying the problem). Then...

Go to the LAST record in the portal.

If the date equals the current date,

Custom Dialog 3 (shows the user the record ID number and a message specifying the problem). Then...

If ANY ONE OR MORE of the above tests are true (i.e. a dialog is triggered), I want to OMIT the record, once the user has a chance to note the information presented in the dialog(s) for that record, and move on to the next record and repeat ALL of the same tests.

If none of these are true, I want to simply move on to the next record in the set and repeat ALL of the same tests.

Exit the loop after all the records are reviewed.

Sounds simple. I can't seem to do it.

I do understand the script steps for creating custom dialogs, counting records in portals, etc. It's the logic that escapes me. I've been messing with Loop, If, Else If and Else (I can't seem to understand the difference between those two), and have considered Case within an IF. But I can't seem to get the sequence right to show all dialogs as needed and then omit that record if necessary.

FM11 Advanced on Mac OSX. Thank you...

Posted

Is the portal relationship sorted? I suppose what I'm asking is, what defines which related record shows in the last portal row? Let's assume it's the last created record.

Go to First Record

Loop

#First test

If ( isempty ( myField))

set $flag ; 1

Show Dialog

End If

#Second Test

If ( count (relationship_portal::keyField) < 2)

set $flag ; 1

Show Dialog

End If

#Third Test

If ( not is empty ( relationship_portal::keyField) // there are related records

gtrr ( relationship_portal)

go to last record

if ( dateField = Get ( CurrentDate) )

set $flag ; 1

Show Dialog

Go to Parent Layout

End If

If $flag =1

Omit Record // you'll end up on the next record

Else

Go to Record Next, Exit after Last

End If

End Loop

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