3 Replies Latest reply on Feb 25, 2011 10:04 AM by philmodjunk

    Typing in Scripts

    ZacharyWebster

      Title

      Typing in Scripts

      Post

      Hello,

      I am very new to FM and I have a question of creating your own scripts. My company recently bought a scanner and want to incorporate it with FM Pro to keep track of inventory (scan items in/out, know different quantities). I tried scanning a barcode and changing the different quantities, but when I plug in my scanner, the barcode just shows up without the different quantities or anything. I searched through the forums and it appears that I need to create my own script to better implement this strategy. I found a script that a member wrote up and I tried entering it in FM and errors were coming up, which I didn't know how to fix.

      For example, on one of the lines is

      Set Field [ Inventory::k_ID_Inventory; Inventory::BarCodeOut ]

      and I don't know where to type in the parts that are in the brackets.

      Thanks for your help!

      Zachary

        • 1. Re: Typing in Scripts
          philmodjunk

          In your script editor, click this step to select it. Now you have two specify buttons that appear in the lower right corner. Click the upper button and select the field you want to the left of the semi-colon. Click the lower specify button and enter or select the field or expression you want to the right of the semi-colon.

          Do not type in the semi-colon, FileMaker will display that automatically in the script editor.

          • 2. Re: Typing in Scripts
            ZacharyWebster

            Hi everyone again, but I have another question on this issue. In the beginning of the other member's code, he has:

            Enter Find Mode [  ] 

            Set Field [ Inventory::k_ID_Inventory; Inventory::BarCodeOut ] 

            Perform Find [  ] 

            When I try to find BarCodeOut it is not listed and I'm not sure how to include this part in the code. When I type it in, the program says that the table cannot be found, and I also want to make it a global variable, but I am unsure of how to procede.

            Thanks for your help!

            Zachary

             

            • 3. Re: Typing in Scripts
              philmodjunk

              That error message tells you that there is no Table Occurrence in Manage | Database | Relationships named Inventory. A table occurrence is what we call the "boxes" in this relationship graph.

              You will be unable to add Inventory::BarcodeOut until you either add a table occurrence of this name, or select a different table occurrence that refers to the inventory table and thus lists this BarCodeOut field.

              If Table Occurrence is a new term, you might want to read this article: 

              Tutorial: What are Table Occurrences?