Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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

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

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.