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.

error trap fails after scripted modify find step

Featured Replies

I am having a brain cramp. I have replaced the generic Find Mode with a scripted Find routine, shown below. All steps functions properly EXCEPT those shown in Red. When that condition occurs, the script somehow bypasses the Status(CurrentError) check and the result is a Found Set of Zero records. I have also tested for the occurence of the "401" error code, and it is there.

Any ideas? Thanks in advance to one and all.

Set Error Capture On

Allow User Abort Off

Enter Browse Mode

If(summary field count of records = Status(CurrentRecordCount)

Set Field (g_user instructions)

Enter Find Mode

Go To Field (desired starting field)

Pause/Resume Script

Else

*************problem appears to start here****************************

Show Message (Buttons: 1New, 2Refine, 3"", Data: desired message)

If(Status(CurrentMessageChoice) = 2)

Set Field (g_user instructions)

Modify Last Find

Go To Field (desired starting field)

Pause/Resume Script

*************problem appears to end here****************************

Else

Set Field (g_user instructions)

Enter Find Mode

Go To Field (desired starting field)

Pause/Resume Script

End If

End If

Perform Find (Replace Found Set)

If(Status(CurrentError) = 401)

Loop

(repeated retrys or exit are allowed here)

End Loop

End If

Go to Record/Request/Page (Last)

Set Field (g_user instructions, "") [email protected]

Your first "Set Error Capture On" script step, I think, should be moved down to be the step just before the find step.

I haven't used multiple find steps like this before, but I believe you need to use a "Set Error Capture On" each time you want to trap for the error, and it needs to be the step just prior to the perform find.

Lee

  • Author

Tried that to no avail. Thanks anyway.

wlewnka said:

If(summary field count of records = Status(CurrentRecordCount)

Set Field (g_user instructions)

Enter Find Mode

Go To Field (desired starting field)

Pause/Resume Script

Else

*************problem appears to start here****************************

Show Message (Buttons: 1New, 2Refine, 3"", Data: desired message)

If(Status(CurrentMessageChoice) = 2)

Set Field (g_user instructions)

Modify Last Find

Go To Field (desired starting field)

Pause/Resume Script

*************problem appears to end here****************************

It looks like you only get to the problem area when your initial IF is not satisified. If your IF is not satisfied, you never each your FIND statement, and go immediately to the ELSE.

Once inside the ELSE, you reach the Modify Last Find statement --- exactly which "last find" is getting modified?

  • Author

If the original condition is not met (i.e. (summary field count of records) DOES NOT EQUAL Status(CurrentRecordCount), then a previous Find command has been issued. The Modify Last Find step is intended to work with that previous Find, whatever it was.

Hope I'm explaining myself properly... THANKS!

But you enter Browse mode just before your test. Won't that lose your previous Find?

I take it your user is entering stuff in a field and you are letting it (the user) play around with what was entered? Why not put the user data in a global field and use that to do the appropriate find(s). I think you are making your find process unnecessarily complex.

  • Author

Curiously enough, the Enter Browse Mode script step does not destroy a previous Find. In fact, I can execute the entire script with a resulting Found Set of zero records, then manually do a Modify Last Find, and be presented with the generic "No Records Match this Request" dialogue.

For some reason, my scripted Modify Last Find step, which can also result in zero records found, is not resulting in an error code of 401 in those instances.

Thanks for your thoughts, though. For the first time in a long time, I am stumped...

There's no reason that entering Browse mode should destroy the parameters used for the last find. If it did, then how would you ever store the requests for an Enter Find Mode [restore] or Perform Find [Restore]? shocked.gif

Could you possibly post the file or a stripped down version of it for us to examine?

  • Author

I have solved my script problem.

After my test for error code 401, I was using a loop to allow the user unlimited tries to either achieve a successful Find or opt out.

My loop included a an exit loop step if StatusCurrentMessageChoice = 2, and I overlooked the fact that the user made a MessageChoice of 2 earlier in the script in order to get to that point - so my loop never fully executed.

Thanks to those who took the time to read my posts and try to help. This forum is a great resource!

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.