Hello FileMaker community! My job kind of threw this project at me and this is my first foray into FileMaker, so please be gentle as I may be a little bit slow. I'm familiar with both coding and database management, but FileMaker has been a bit different than what I am used to seeing.
Anyway, here is my project:
I am designing a simple receptionist program that allows guests to sign in using an iPad with FileMaker Go connected to a database on FileMaker Pro. The main menu features two buttons: "Sign In" and "Sign Out". When "Sign In" is pressed, the attached script (Get Name) runs. As you can see in the script, the visitor is encouraged to type in their first and last name in a Custom Dialog. These are then used as Find criteria to determine if this person has visited us before, and a different Go To Layout step is used depending on the result of this Find. I am aware this is not a good way to determine whether this is a new visitor or not, names not necessarily being unique and all, but it will work for my company's purposes and has been fairly easy to implement in the timeframe they've given me. The rest of the project works more or less as intended, except for the initial sign-in.
The problems are twofold:
- If the user hits the "Cancel" button on the Custom Dialog, the rest of the script executes anyway, leaving the user in the "New Visitor" Layout with nothing pre-populated. Is there a way to execute the lower portion of the script (lines 11 onward) only if the "Ok" button is pressed in the Custom Dialog, such as a "Break Out" command? Could the Get Name script be split into two so that the second portion executes on press of the "Ok" button? With my limited familiarity with the program, and even moreso Custom Dialogs, I'm not even sure if using a Custom Dialog is the best way to go about this part of the process. I am thinking there might be a way to capture the button selection from the Custom Dialog and feed that into the lower part of the script using a Global field, but I'm not sure.
- The Else portion of the If-Else block is never executing, even if a repeat user types in their name exactly as they did before. I suspect this is because the LastError field may be populated by some other area of the project, or previous runs. Is there a way to clear this field before using it as logical input? Is this even how the LastError field works?
Thank you for your help. I apologize for having to attach the script as I have. I cannot seem to figure out how to export or copy the script text to place here...