1 Reply Latest reply on Mar 15, 2013 12:37 PM by philmodjunk

    If function

    MehrdadBastan

      Title

      If function

      Post


           Hi Everyone,

           I have a created a very simple inventory database and would like to get your help.

           Here are the fields in my database

           SKU#

           Item Name

           Manufacturer

           Price

           Qty

           Extended Price

           I would like to Scan a bar code and if the SKU# is not in the database already the script to open a DATA ENTRY LAYOUT and allow me to enter the info. However if the SKU# already exist I need the script to just add one more to the quantity. No need of creating a new record in that case.

           what is the simplest way to write this script?

           Thanks for your help

            

        • 1. Re: If function
          philmodjunk

               You may find this thread on bar code scanning useful: Need help writing script to integrate barcode scanning

               If you scan the barcode into a global field, you can use that field as a match field in a relationship to check for the existance of a record with that barcode.

               LayoutTableOccurrence::GlobalBarCodeField = Inventorytable::BarCodeField

               then, in a scirpt:

               If [ IsEmpty ( InventoryTable::BarcodeField ) ]

               will be true if there is no existing record with that barcode and your script can then create a new record.