Skip to main content
July 27, 2023
Solved

How to generate an identifier for each Purchase Order Line

  • July 27, 2023
  • 5 replies
  • 0 views

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!

    Best answer by harshm4411

    In that text field you can provide value: fv!index which will provide you the index for each row.

    5 replies

    harshm4411
    July 27, 2023

    In that text field you can provide value: fv!index which will provide you the index for each row.

    July 27, 2023

    Thanks! This worked for me

    stefanhelzle0001
    Brainy
    July 27, 2023

    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.

    July 27, 2023

    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

    stefanhelzle0001
    Brainy
    July 27, 2023

    OK, then it is just some number, but not the primary key of the item. That is OK, but it's important to differentiate. And you cannot use that number as the primary key in the database table.