4 Replies Latest reply on Nov 5, 2009 9:58 PM by Murugan

    How do I create a new record automatically once barcode has been scanned Using FILEMAKER PRO 10

    Murugan

      Title

      How do I create a new record automatically once barcode has been scanned Using FILEMAKER PRO 10

      Post

        Hi guys,

                     when i load layout have one barcode text field . i have set focus in barcode textfield.

                       

                      i want  create a new record automatically once barcode has been scanned.              

                  

       

                     help me. i have searched many sites but i cant get opt solution... 

       

      advance thanks

       

       

       

        • 1. Re: How do I create a new record automatically once barcode has been scanned Using FILEMAKER PRO 10
          SaterInc
            

          I'm not firmilar with the barcode scanning with filemaker pro but I would think a script trigger would do what your looking for.  In edit layout, right click your field for your barcode, and then set script triggers, click the OnObjectSave option and for your script just use the "New Record Request" function.

            If all goes well, it should automatically run the script to make a new record after your barcode field is modified and commited.

          • 2. Re: How do I create a new record automatically once barcode has been scanned Using FILEMAKER PRO 10
            ninja
              

            Howdy,

             

            I also have not used scanning as a data entry tool, but I understand that it is treted simply as an input device like a keyboard or number pad.

             

            Another way to trigger the script is to have a temporary holding field "Tempcode" in the entry table that is set up as a global field.

            You could then trigger an entry script on modification of that field:

             

            Set Variable [$barcode ; Tempcode ]

            New Record/Request

            SetField [<yourtargetfield> ; $barcode ]

            Setfield [ Table::Tempcode ; "" ]  ###to clear out the barcode

             

            I'm not sure if the last step would trigger the script again or not, you'll want to verify this.  If so, you would want to look for a different trigger point for the script.  My thought on the benefit of this approach is that you would not create the new record until you actually scan a barcode.  You could also scan a barcode while sitting on an existing record without overwriting the existing record.

             

            Just thinkin' out loud...put more trust in someone who's actually used the barcode scanner input.

            • 3. Re: How do I create a new record automatically once barcode has been scanned Using FILEMAKER PRO 10
              david_lalonde@d-cogit.ca
                

              I have used barcode scanners. Each has its own way of doing things.

               

              Some barcode scanners allow the addition of a sentinel character at the start of the scanned barcode. If yours does, then create a starting sentinel character (a control or command key combination) that will trigger a script in FileMaker Pro that will create a record and place the focus in the desired field. The script could perform other functions as well, depending on your coding prowess. Time could be of the essence - it is possible the barcode scanner will not leave sufficient time for the script to perform its duties before the data is streamed.

               

              Failing that, most barcode scanners allow the addition of a sentinel character at the end of the scanned barcode. My suggested solution will assume only a sentinel character can not be added to the start of the scanned barcode, as it is the most restrictive.

               

              I do not know the particulars of your solution. I will assume the person entering barcode information does not need to view records before or after entering the barcode information. Otherwise, there is little point in automating the creation of records because it is just as efficient to press a button (to create the new record) at it is to put the focus in one field.

               

              My solution:

               

              Make a layout that contains an OnLayoutKeystroke script trigger. The target script will branch on one of three possibilities: the character being read is the end of scan sentinel character; the current found set of records is empty; the current found set of records is not empty.

               

              If the character being read is the end of scan sentinel character, this is the scanner's indication the scan is complete. The end of scan sentinel character is not data. The target script needs to exit with a zero result so that the character is ignored. Before exiting, the target script should perform any processing of the data that is required, commit the record and omit the record from the found set to return to an empty set of records.

               

              If the current found set of records is empty, this means the character being read is part of a new scan. The target script should create a record, perform any required pre-processing, then place the focus in the field that will accept the scanned data. The target script needs to exit with a non-zero result so that the character is recorded by the field.

               

              If the current found set of records is not empty, this means the character being read is part of an existing scan. The target script may need to perform some processing (depending on your solution). If this is the case, make sure the focus comes back to the field that will accept the scanned data (if focus ever left it) and make sure the cursor is at the end of the field (if the cursor was ever moved). The target script needs to exit with a non-zero result so that the character is recorded by the field.

               

              I hope this suggestion was useful,