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

Don't go back to last layout if no records found.

Featured Replies

Hi,

I'm a newbie trying to make a script and, after a few days of messing with it, am in need of some help. I'm making a Medical Record script for my summer camp kids which has 3 tables. Demographics, Encounters, and Medications log. My script uses the patients name as the constraining information and goes to each table, looks for the patient, and then prints the data. What I should end up with is the demographics cover sheet showing name, age, etc.; a list of all meds I've given and a list of all encounters. It works fine if the patient has atleast one record in each table, but if they don't, it goes back to the last table and prints it again. So, I start with demographics, it find the patient, prints all their background info, then it looks for encounters, doesn't find any, returns to demographics, and prints the form again. I'd like it to just print an encounter list with no records and move on. Sorry for the long winded explanation, I don't have the FM lingo down quite yet. smile.gif

Randall

Randall:

Welcome to the Forums. You need to put Set Error Caputure [on] before each find, then check to see if there is a found item before you print, so each Print statement would be within an If statement:

If [Get(FoundCount)>0]

Print[]

End If

What's happening currently is that you're getting no found set, then the Print statement kicks in, and it just prints whatever it sees...

-Stanley

  • Author

Thanks for the quick response!

The script works but too late. As soon as it realizes that there are no records matching the search it goes right back to the original layout which, of coures, has a find value of >0 so it prints it.

Using

If [not IsEmpty( Encounters::serial )]

Go to Related Record [show, Encounters]

Perform Script [External, Print]

End If

from the Demographics file would prevent even going to the Encounters file if there are no related records. And a find isn't necessary if you have a valid relationship.

  • Author

Got it fixed! Thank you very much!!!

Randall

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

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.