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.

try again

Featured Replies

ok.. trying again.. using this script below

New Script

Go to Layout [ “Layout #36” (nasd_NOTE__cno) ]

Perform Find [ Specified Find Requests: Find Records; Criteria: nasd_NOTE__cno::Tried: “Tried” ]

[ Restore ]

Loop

If [ nasd_NOTE__cno::ndate < nasd_NOTE__cno::st_date ]

Omit Record

End If

If [ nasd_NOTE__cno::en_date > nasd_NOTE__cno::ndate ]

Omit Record

End If

End Loop

what i want this to do is find all records with the "tried" field filled in, but i want it to only add the ones in the date range to the found set, it ignores both if lines and stays in the loop until i hit esc..

what gives?

You haven't specified any exit condition for the loop. How is it supposed to know when to stop? You want something like this:

Loop

   If [ nasd_NOTE__cno::ndate < nasd_NOTE__cno::st_date ]

     Omit Record

   Else If [ nasd_NOTE__cno::en_date > nasd_NOTE__cno::ndate ]

     Omit Record

   Else

     Go to record (next; exit after last)

   End If

   Exit Loop If( Get( FoundCount ) = 0 )  // in case all records are omitted

 End Loop

  • Author

that makes sense, thank you for the feedback.. so i edited my script as you described, i think i need different criteria for the loop to end though, since it finds 11000 matches, it just continues on..i think it may be ignoring my date range also.. would turning error capture on make it report script errors to me? maybe help me diagnose whats not working?

New Script

Go to Layout [ “Layout #36” (nasd_NOTE__cno) ]

Perform Find [ Specified Find Requests: Find Records; Criteria: nasd_NOTE__cno::Tried: “Tried” ]

[ Restore ]

Loop

If [ nasd_NOTE__cno::ndate < nasd_NOTE__cno::st_date ]

Omit Record

Else If [ nasd_NOTE__cno::ndate > nasd_NOTE__cno::en_date ]

Omit Record

End If

Exit Loop If [ (Get ( FoundCount ) = 0) ]

End Loop

also, just to provide more info, this table is a notes portal, ndate is the date of the note st_date is a global field i added to a new layout for this report I'm trying to produce, en_date is the end date, also a global field (i tried using a date field on a previous attempt) the script seems to be ignoring both if statements, i get the same number of results no matter what date i enter.

Edited by Guest

You better look at my example again.

  • Author

doh! i see it now, sorry about that.. it does now exit the loop, i just have to figure out why it doesn't like my dates, thanks

New Script

Go to Layout [ “Layout #36” (nasd_NOTE__cno) ]

Set Error Capture [ On ]

Perform Find [ Specified Find Requests: Find Records; Criteria: nasd_NOTE__cno::Tried: “Tried” ]

[ Restore ]

Go to Record/Request/Page

[ First ]

Loop

If [ nasd_NOTE__cno::ndate < nasd_NOTE__cno::st_date ]

Omit Record

Else If [ nasd_NOTE__cno::ndate > nasd_NOTE__cno::en_date ]

Omit Record

Else If [ nasd_NOTE__cno::initials ≠ nasd_NOTE__cno::rpt_initials ]

Omit Record

End If

Go to Record/Request/Page

[ Next; Exit after last ]

Exit Loop If [ (Get ( FoundCount ) = 0) ]

End Loop

You really, really need to look again at my example and do it this way:

ELSE

Go to next

END IF

The way you've done it is a classic mistake:

- it omits record A,

- you'll be on record B,

- it will go to the next record C

- i.e., record B is never checked.

  • Author

you were right about the loop not evaluating all the records the way i had it, but when i try to add in the "else" before the exit, i get a never ending loop, this script looks different then the one i originally posted, but the if/then structure is basically the same

recruit stats

Go to Record/Request/Page

[ First ]

Loop

If [ nasd_NOTE__cno::Tried ≠ "tried" ]

Omit Record

Else If [ nasd_NOTE__cno::TT ≠ "TT" ]

Omit Record

End If

Go to Record/Request/Page

[ Next; Exit after last ]

End Loop

Go to Record/Request/Page

[ First ]

Loop

If [ nasd_NOTE__cno::initials = "KAT" and nasd_NOTE__cno::Tried = "Tried" ]

Set Variable [ $kattried; Value:$kattried+1 ]

Else If [ nasd_NOTE__cno::initials = "KAT" and nasd_NOTE__cno::TT = "TT" ]

Set Variable [ $kattt; Value:$kattt+1 ]

Else If [ nasd_NOTE__cno::initials = "DAP" and nasd_NOTE__cno::Tried = "Tried" ]

Set Variable [ $daptried; Value:$daptried+1 ]

Else If [ nasd_NOTE__cno::initials = "DAP" and nasd_NOTE__cno::TT = "TT" ]

Set Variable [ $daptt; Value:$daptt+1 ]

Else If [ nasd_NOTE__cno::initials = "JID" and nasd_NOTE__cno::Tried = "Tried" ]

Set Variable [ $jidtried; Value:$jidtried+1 ]

Else If [ nasd_NOTE__cno::initials = "JID" and nasd_NOTE__cno::TT = "TT" ]

Set Variable [ $jidtt; Value:$jidtt+1 ]

Else If [ nasd_NOTE__cno::initials = "HML" and nasd_NOTE__cno::Tried = "Tried" ]

Set Variable [ $hmltried; Value:$hmltried+1 ]

Else If [ nasd_NOTE__cno::initials = "HML" and nasd_NOTE__cno::TT = "TT" ]

Set Variable [ $hmltt; Value:$hmltt+1 ]

Else

Go to Record/Request/Page

[ Next; Exit after last ]

End If

End Loop

Set Field [ nasd_NOTE__cno::zc_katcount; $kattried + $kattt ]

Set Field [ nasd_NOTE__cno::zc_tt_katcount; $kattt ]

Set Field [ nasd_NOTE__cno::zc_jidcount; $jidtried + $jidtt ]

Set Field [ nasd_NOTE__cno::zc_tt_jidcount; $jidtt ]

Set Field [ nasd_NOTE__cno::zc_dapcount; $daptried + $daptt ]

Set Field [ nasd_NOTE__cno::zc_tt_dapcount; $daptt ]

Set Field [ nasd_NOTE__cno::zc_hmlcount; $hmltried + $hmltt ]

Set Field [ nasd_NOTE__cno::zc_tt_hmlcount; $hmltt ]

did i do the else/exit wrong?

Now you have two loops. You still haven't done the first loop the way I showed you, so some records will be skipped over and not evaluated, as I explained in my last post.

Your second loop does not perform any Omit, so by putting the go to next/exit following the else, you've created an endless loop.

Remove the else from the second loop.

Insert an else in the first 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.