AnsweredAssumed Answered

Script to deal with Find that doesn't Find

Question asked by StanleySilverman on Aug 16, 2011
Latest reply on Aug 17, 2011 by StanleySilverman

Title

Script to deal with Find that doesn't Find

Post

I'm new to FMP and am working on a database that will allow me to follow patients in an intensive care unit on a daily basis.  I developed a script that will carry over data from the day before to the next day but need a way to deal with what happens if there was no data from the day before.  Here's the current script:

 

Set Variable [$date; Value: "=" & Get(CurrentDate)-1]

Perform Find [Restore] where Restore is ICU::Date [$date]

Contrain Find [Restore] where Restore is ICU::Room# [375]   - this contrains the find to the record that was present yesterday in room 375.

Duplicate Record/Request

 

This Script works find if there is a record from the day before to copy.  However, if there is no record I want the script to just generate a new Record with the room number autofilled (Room 375).  If that's not possible I at least want to avoid "No records match this find criteria." window that pops up.

Any help would be appreciated.

Outcomes