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

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

Recommended Posts

Posted

I run a find in a script, but want to run it w/out dialogue. For instace, when it doesn't find anything, i want it to skip that step and move on. I know you have to do something with error capture.

Thanks

-j

Posted

Cretae a global number field in your database to store the error code -- " gError". Script steps would then be:

Enter Find Mode []

<stuff to make find requests>

Set Error Capture [on]

Perform Find []

Set Field [gError, Status(CurrentError)]

Set Error Capture [off]

If [gError = 0]

# stuff when records found

Else

# the find step generated an error of some sort

If [gError = 401]

# no records match this request

<script stuff when no records found>

Else

# some other error, may indicate a problem

<script stuff when a real find error occurs>

End If

End If

Note in the script that I have included conditionals to work out when no records are found, and another when some other error occurs. For instance, error 400 is "Find criteria is empty" -- you probably don't want to do your <no records found> script steps when in actual fact the user clicked the Find button without typing anything!

That's called Defensive coding.

For instance, the script could be expanded to handle this instance...

If [gError = 0]

# stuff when records found

Else

# the find step generated an error of some sort

If [gError = 401]

# no records match this request

<script stuff when no records found>

Else

If [gError = 400]

# no find criteria

<script stuff when no criteria entered>

Else

# some other error, may indicate a problem

<script stuff when some other unexpected error occurs>

End If

End If

End If

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