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

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

Recommended Posts

Posted

Okay, if you haven't been following some of my other questions, a brief overview. I have a FM3.0 application that deals with patients at a huge hospital. It is very poorly designed and implemented. I have to pick up the pieces and am NOT a FM guru (yet crazy.gif)

Here is my next question.

I have an outside system that handles appointment scheduling. When a patient is scheduled or admitted to the hospital the scheduler FTPs their SSN to a folder on my FM server as a text file. A small FM app checks this folder every 5 seconds. When a text file is found, it imports it, reads the SSN, deletes the text file, uses the SSN to do a search of the main FM app for that patient. The FIND results are exported to a tab file and then, with a DOS batch file, FTP'd to the scheduler. I have absolutely NO control over the scheduler side of this.

Now the problem is that when the FIND fails, the previous FIND results are sent to the scheduler. Luckily they check to see that the SSN matches, which it won't.

So the question is, how do I make sure that if a FIND fails to find anything, it returns nothing? Actually I would love to make it return a statement of "NO FILE FOUND" and send that back to the scheduler.

Posted

Set Error Capture [On]

Perform Find

If [status(CurrentError)]

Send Message [someapp.exe "No file found"]

Else

script steps for normal result

End If

Posted

oooooooooo

Mahalo nui loa (Hawaiian for thank you very much) for the quick response. I'll give it a shot. I had tried catching the error but I think I have the Perform Find outside the catch.

If I do too much more of this, I will be answering questions for others. ooo.gif

Posted

You're welcome. You can also be more specific in what the actual error number is, if necessary. In FileMaker Help lookup status, find the error section, and you'll have a list of codes with which to work.

Posted

Let's compare and see what the differences are and how they might affect the results. Here is what I currently have. This script is on Chart.fm_ but the search is based on the Index.fm_???:FMPSSN field:

Set Error Capture[on]

Go To Layout["personal info"]

Enter Find Mode[]

Paste[select,"Index.fm_::FMPSSN"]

Set Field["gen.lname active","">0""]

Perform Find[Replace Found Set]

If["Status(CurrentError)=0"]

Export Records[Restore, No Dialog, "patient.tab"]

Else

Send Message["notfound.bat","aevt","odoc"]

End If

Now I see that things like Status(CurrentError)=0 are in quotes while in your script they are not. In my experience putting something in quotes makes it a string, is that what is happening here?

In the line Set Field ... he was trying to ensure that the patient was active, because he set it up so each time a patient was admitted they got a new record and then when they were discharged the record was placed inactive. But I'm wondering if this works or if it should be another PASTE into that field.

Posted

The quotes appear when you're viewing the script, but when you enter the calculation, they aren't there, which is why I didn't show them so as not to be confusing.

I'm concerned about the Paste[] being activated when no field has been selected on the layout. I would Go to Field[fieldname] to ensure the correct field is selected before the Paste, in case tab or field order is modified in the future. Also, where does the Copy occur that relates to this Paste?

In your Perform Find, do you mean Restore Find Requests instead of Replace Found Set? And if so, what is the original request that's being restored and will it overwrite the Paste and Set Field you've already performed?

Your Status(CurrentError) should work, unless restoring the find request is squelching an error, which I don't believe it should. But your Find might be blowing out the Paste and Set Field you've enacted. Can you run this script after adding an Exit Script after the Perform Find to see what your result is?

Posted

Is there an easy way to copy the scripts? confused.gif Just takes so long to type each one out.

There are actually 6 scripts that handle all of this. BUT leading into this there is a script that imports the data which is basically one field the SSN (called FMPSSN)

Once this is imported there is a script that copies the FMPSSN field. Then it is pasted in the script I printed out.

Posted

You can copy the calculations for the script steps, but not the actual scripts themselves. Print screens are about the best option for that.

Hmm. What's the relation to Index.fm_?

Posted

Put a Pause/Resume just before the Perform Find to see if the data is being entered properly.

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