I'd set up a form view layout for this where every field located on this layout is a field with global storage. When the user completes the form, they tap a button labeled "save". That button performs a script that:
- Checks for correct complete data entry and highlights any deficiencies that need to be corrected/completed by the user.
- Creates a new record in your database table and copies the data from the global fields to corresponding non-global fields in this new record. Auto-enter calcs can be used so that all that need take place is the new record/request script step.
Clears all of the global fields so that the layout is ready for the next user.
A cancel button can just do part 3 above. And there are ways to use InstallOnTimerScript to also cancel the input after a specified interval if the guest walks away from the device without completing the data entry.
Thanks for the reply. Can you please explain the recommendation for setting up fields for global storage which are subsequently copied versus creating a layout view that contains the fields in the table where they will ultimately reside?
Thanks so much
It makes canceling out of the registration process much simpler to implement (no new record is created until data entry is complete and valid) and also keeps users from having any possible access to another person's registration data as they will be on a layout that only displays data from the global fields.
Thank you. This makes perfect sense and is very helpful. Unfortunately, I'm a newbie and am struggling with some of the steps you've proposed. Would you be interested in doing a bit of work for hire? Thanks.
Thank you! Your feedback has been incredibly helpful. I'm almost there. Let me explain what I've done and where I'm stuck. I'm guess you'll spot my errors immediately.Accomplished
- Created global fields in the master table
- Created an iPad specific layout using these global fields along with a Save button that triggers a "Submit" script (below)
- Created a "submit" script that uses Set Field Name to copy each global field value to its non-global counterpart; uses Show Custom Dialog to instruct customer where to do next (eg. proceed to the check-in area) and use the New Record/Request to clear and create a new record
- Created a "Customer" user and set privileges to restrict it to just the one layout
- Determined that using IOS Global Access I can actually block specific areas of the screen from being accessed, like FileMaker pro settings
- The form works fine from an iPad and writes new records, however, a few challenges persist
- Users can still browse records using the FileMakerGo navigation. They don't see any data, however, if they happen to select an existing record their entry will overwrite the data in that old record. I'm wondering if I should create a separate table for these global fields?
- One the of fields in the master table is set up as a Serial Number set to increment by 5 each time a new record is created to provide a unique ID for each record. I'm using a CNS barcode plugin to calculate a container with a barcode image from this number. When I enter a record via the iPad, the UID is correctly generated in the table, however, the CNS plugin won't create the barcode. If I go into that record, select the data, remove it and then paste it back in the plug-in generates the barcode. Also, if I enter a customer registration record from a computer using the same exact layout I have no issue with the plugin.
- What is the best way to ensure that fields are not empty?
- What is the best way to validate a properly formatted email address (e.g.. no leading/trailing spaces, presence of "@ "and "." as well as invalid characters?
- What is the best way to validate a properly formatted phone number as xxx-xxx-xxxx?
Thanks again for all of your help.
Users can still browse records using the FileMakerGo navigation. They don't see any data, however, if they happen to select an existing record their entry will overwrite the data in that old record. I'm wondering if I should create a separate table for these global fields?
Sounds like your script is missing a step where it first creates a new record and thus does not over write any existing data. But yes, putting the global fields in their own table would be useful and this does not require any script chanes as long as you have global storage specified for these fields
2 Plug ins are not supported in FileMaker GO. You'll need to use a computer with FileMaker Pro installed to use the plug in.
3. Not Isempty (Yourfield)
In a script, you can have steps like:
If [IsEmpty (YourTable::Globalfield1) // user error ]
Show Custom Dialog ["Please enter data in to field 1" ]
That is performed when the save button is clicked. You can also put such code into script triggered by the ONObjectValidation trigger, but this is simpler for a novice to set up.
4. For the last two, I'd combine an auto-enter calculation speciifed in Field options to "fix" most issues and then check for errors in the same script as the portion shown above.
For the email address field, you can use Trim ( self ) as an auto-enter calculation to just remove leading and trailing spaces. Then this code will check for the existance of one @ and at least one period to the right of it.
If [ PatternCount ( Yourtable;;Field ; "@" ) = 1 and Position ( YourTable::Field ; "." ; Length ( YourTable::Field ) ; -1 ) > Position ( YourTable::Field ; "@" ; 1 ; 1 ) ]
5. Again we use an auto-enter calculation to strip out all user supplied formatting and add our own to get consistent data entry. Your script can then use the Length function as a test to confirm that the number is the correct length.
This is for US phone numbers. It will need changing for numbers in other countries:
See this thread for a sample calculation: Formatting a text as phone number
@PhilModJunk - Thank you so much for taking the time to help me. I've managed to get through every issue and have learned so much as a result of your guidance. I now have a production solution in place that works great! Thanks again. RLM