1 Reply Latest reply on May 15, 2012 11:47 AM by IT_User

    Product's Code

    moj6054

      Hi, every one.
      I have a problem, for Product's code.
      I want give code to product according product's category. I mean, I have :
      category table(catID,CategoryName) in this table have some record (Board,CT,Cable,..)
      Product Table(ProID,catID,ProductName) in this table some record
      and link two table (category::catID - Product::catID)
      I want give to this product a code like this: if in category table (Board's ID=1) then in product table, productID=11 and for second product in this table product'ID = 12 and go... and

       

      if in category table (CT's ID =2) then in product table, productid=21 and second product in this table product's ID= 22

       

      Please help me,
      Thank you very much

        • 1. Re: Product's Code
          IT_User

          I know in the one database we have is that we have a product ID that is sequential.

          Then we also have calculation fields that is based on the product ID and other factors. (that would just be a concatenation: category & productID) If there isn't a category chosen yet the product ID would still be calculated, and it would look the same as the product ID until the category is chosen.

          You can keep the primary product ID, but mainly use the new calculation field for relationships.

           

          -----

          And if the calculation field is to slow there is another field that is static (a text or number field) which is updated whenever the field is needed.  Also, it is updated in a server script that runs in the middle of the night.

          ----