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

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

Recommended Posts

Posted

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]

Posted

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

Posted

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?

Posted

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!

Posted

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.

Posted

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

Posted

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?

Posted

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!

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