Script to Validate Unique Entry?

Discussion created by bradleyboggs on Sep 26, 2013
Latest reply on Sep 26, 2013 by Mike_Mitchell

Hi All!


Thank you in advance for your help! Please pardon me if this is repeating something on the forums - tried to find what I needed but couldn't quite get where I need to be.


I have a Filemaker Go layout for warehouse personal who pull materials for custom manufactured jobs. I have a JobNum field which needs to have a unique job number. They need to search this field and if no records exist, create a new record. Originally I used the Filemaker Validation to make sure this value was unique, and that worked okay. Now though, I prevent field entry on this field in browse mode on the main layout, so that they can't accidentally modify the job number of an existing job. To create a new job, they click a "New Order" button which takes them to a new layout with one field for the Job Number.


They enter the job number here to create the record, then click a "CREATE ORDER" button which runs a script to commit the record and send them back to the original layout with order details. The only caveat to this, is that with the built-in Unique Validation, it brings up multiple pop-ups asking about reverting records, etc. and then pop-ups re: stopping the script that runs to commit and send them back to the main layout, etc.


What I want to do is this: Have them enter a job number and click the "Create" button and run a script that looks for that job number. If that job number exists, it kicks them to the proper releated record for that job number. If that job number ISN'T found, I want it to create the record, then send them to the related record in the proper layout. I have it working 99% with the script I've pasted below.


My only issue with the below script is that after the find (testing this on my desktop mind you), there's a dialog box that says "No Records Match This Criteria" with 3 buttons: "Modify Find", "Continue" and "Cancel". If I hit continue, it creates the record and goes to the proper layout as it should. Ideally, I'd like to supress this dialog box and just proceed with the script...



Set Variable [ $temp; Value:Orders::JobNum ]

Perform Find [ ]

If [ Get ( FoundCount ) = 0 ]

New Record/Request

Set Field [ Orders::JobNum ; $temp ]

Commit Records/Requests

Go to Related Record [ From table: “Orders”; Using layout: “MatTrack_WH” (Orders) ]

Halt Script


Go to Related Record [ From table: “Orders”; Using layout: “MatTrack_WH” (Orders) ]

Halt Script

End If



Thank you again for your help!