How to generate an identifier for each Purchase Order Line

Hi! I´m constructing an editable grid in which the user can add new rows (purchase order lines). I would like to add a column with the number of the row as an "identifier" for each PO line, something like this:

So my question is, how can I configure the text field to auto-generate values from 1 to infinite after the user adds a new row?

Thanks for your time!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Is this just a number, or should this become the primary identifier for this item?

    And what is the purpose of this number? Is that something you really need? I built similar grids many times and never included such a number.

  • I want this number to be the identifier of the line for EACH Purchase Order. In order to explain myself, what I want:

    PO 1 

    - 1 --> PO 1, material, price, quantity

    - 2 --> PO 1 material, price, quantity

    If I create another Purchase Order (re-start process):

    PO 2 

    - 1 --> PO 2, material, price, quantity

    - 2 --> PO 2, material, price, quantity

    To save the lines of the PO, I created a record in which id_Line_PO is the primary key. But with this configuration, it appears something like this (if I create a new PO, the number auto-generated in the record is still acumulative):

    PO 1

    - 1 --> PO 1, material, price, quantity

    - 2 --> PO 1 material, price, quantity

    If I create another Purchase Order:

    PO 2

    - 3 --> PO 2, material, price, quantity

    - 4 --> PO 2, material, price, quantity

    My purpose is to identify each PO line  inside a PO

Reply
  • I want this number to be the identifier of the line for EACH Purchase Order. In order to explain myself, what I want:

    PO 1 

    - 1 --> PO 1, material, price, quantity

    - 2 --> PO 1 material, price, quantity

    If I create another Purchase Order (re-start process):

    PO 2 

    - 1 --> PO 2, material, price, quantity

    - 2 --> PO 2, material, price, quantity

    To save the lines of the PO, I created a record in which id_Line_PO is the primary key. But with this configuration, it appears something like this (if I create a new PO, the number auto-generated in the record is still acumulative):

    PO 1

    - 1 --> PO 1, material, price, quantity

    - 2 --> PO 1 material, price, quantity

    If I create another Purchase Order:

    PO 2

    - 3 --> PO 2, material, price, quantity

    - 4 --> PO 2, material, price, quantity

    My purpose is to identify each PO line  inside a PO

Children