0 Replies Latest reply on Jan 23, 2014 9:36 AM by ericjlindholm

    script help

    ericjlindholm

      Title

      script help

      Post

           I have a Prep/Pull layout that lists line items associated with an equipment list.  There is a Portal displaying usage instances on every line item.  This script is trigger when I scan or type a barcode into the LineItems::gBarcode Scan field.  It warns you if the item scanned is not the same as the quoted item, and when you have scanned the quotes amount of items.  The last part I need is it to warn the user if that barcode has already been associated with a usage instance for the current line item.  I cannot seem to find a function that gets my brain moving in the right direction.  thoughts?  thank you all!

            

      If [ not IsEmpty(Line Items::gBarcode Scan) ]
      Set Variable [ $Barcode; Value:Line Items::gBarcode Scan ] Set Field [ Line Items::gBarcode Scan; "" ]
      If [ Line Items::Qty quote Inv usage LI::Scanned Amt ]

      Show Custom Dialog [ Message: "Sent qty matches quoted qty. are you sure you want to send more then the quote calls for "; Default Button: “Yes”, Commit: “Yes”; Button 2: “No”, Commit: “Yes” ]

      If [ Get ( LastMessageChoice ) =2 ] Exit Script [ ]

      End If End If

      Go to Object [ Object Name: "Sent Items Portal" ] Go to Portal Row

      [ Select; Last ]

      Set Field [ Inv usage LI::Barcode; $Barcode ]

      Commit Records/Requests

      [ No dialog ]
      If [ Inventory::ID Inv_Usage_Sub Items_Used::Master Inv ID ]

      Show Custom Dialog [ Message: "The scanned it is not same as the quoted item. Do u want to allow this item to be subsituted for the quoted item?"; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]

      If [ Get ( LastMessageChoice )=2 ] Delete Portal Row

      [ No dialog ] End If

      End If
                          Go to Field
      [ Line Items::gBarcode Scan ]

      [ Select/perform ]

      End If