3 Replies Latest reply on Aug 15, 2015 11:29 AM by philmodjunk

    Creating product Serial No.s for a Product

    user21605

      Title

      Creating product Serial No.s for a Product

      Post

      Hi All,

      Hoping someone can point me in the right direction.  Need to create a product serial number.  The problem I have is I need to add/create more than one serial number if the Qty of the product is more than one.  Therefore if  there is 1 product create one serial number, if there are 2 products create two serial numbers etc.  Needs to be for one record already in line items.  I was using a combination of line item ID, quote ID etc to create a serial number which of course needs to be unique.

      I was looking at a 'if' script but I could only think of one step for each quantity amount. I was thinking there maybe a way to identify the quantity amount and use that to create that amount of serial numbers tagged to the product description.

      Hope this makes sense.  I have attached a picture of what I'm trying to achieve.

      Thanks
      Brandan

      Capture.PNG

        • 1. Re: Creating product Serial No.s for a Product
          philmodjunk

          Set up an additional table where you create one record for each serial number. Set up a field in this table to produce a serial number. A simple number auto-entered as a serial number would be simplest. You can use a script that takes the Qty specified and generates the needed records in this table and links them by line item ID to the correct line item. A calculation can then pull them as a comma delimited list into the field shown above.

          • 2. Re: Creating product Serial No.s for a Product
            user21605

            Hi Phil

            Which script steps would you use for 'You can use a script that takes the Qty specified and generates the needed records'.  ?

            So I have created the serials table and linked it to the line items table.  I have started a script that sets variables for line item ID and Qty but not sure how to tell the script to create the right amount of records as per the Qty.

            Thank you for your help !

            • 3. Re: Creating product Serial No.s for a Product
              philmodjunk

              Set Variable [$Qty ; value: OriginalTable::Qty ]
              Go to Layout ["Serials" (Serials)]
              Loop
                  Set Variable [$K ;value: $K + 1 ]
                  Exit Loop If [ $K > $Qty
                  New Record/Request
              End Loop

              The above is just the "bare bones". You may need to flesh this out with more code to handle what else besides creating a new record needs to be done.