1 Reply Latest reply on Jul 28, 2015 7:49 AM by philmodjunk

    Need Help on Search for Duplicates Using Scripts

    ManuelJrMendoza

      Summary

      Need Help on Search for Duplicates Using Scripts

      Product

      FileMaker Pro

      Version

      12

      Operating system version

      Mac

      Description of the issue

      I am not sure if this is an issue but I am having difficulty creating a script to search for duplicates. 

      Here are the data fields:
      1. Account Number
      2. UserName
      3. Date Scanned
      4. Time Scanned

      Here is the logic:
      1. Account number is scanned using bar code scanner.
      2. Perform find
      3. If there is a duplicate account number, that scanned account number is rejected.
      4. If there is no duplicate account number, that scanned account number is saved.
      5. Then moves to next account number.

      Steps to reproduce the problem

      Go to Layout
      Set Error Capture [On]
      Set Variable
      Enter Find Mode
      Set Field
      Perform Find
      If [Get (LastError) > 0]
           Show Custom Dialog (...
           If [Get (Last MessageChoice) = 1]
               Modify Last Find
           Else
               Enter Browse Mode []
           End If
      End If
      Set Error Capture [Off]

      Expected result

      It should be able to find out if the scanned account number has duplicates.  If it has duplicates, reject the account number.  If no duplicates, save it.

      Actual result

      It just stops at Enter Find Mode.

        • 1. Re: Need Help on Search for Duplicates Using Scripts
          philmodjunk

          Report An Issue is intended for Reporting Possible Software bugs. Questions on how to work with FileMaker Pro should be posted in the FM Pro Forum Section. (See tab at top of this screen.)

          It sounds like your 4th script step is:

          Enter Find mode [pause]

          instead of:

          Enter Find Mode []

          Clear the pause check box for this script step and it will no longer pause.

          Note that since you are scanning a bar code, you could scan into a field used as the match field in a relationship that links to the records you are searching. You can then check for the presence of a related record instead of performing find to determine that a record with the scanned bar code already exists.