Sequential number on custom field

SOLVED

Hi all,

I am trying to create a sequential number logic for a custom field, and I appreciate if someone helps me with a step by step to how to create a sequential number structure for a custom field.

The field is on SIH and PIH screen, currently data type (UNQ), the idea is when creating a register the system populates the field with a sequential number which can be edited after.

Thanks!

  • FormerMember
    +1 FormerMember
    verified answer

    Hello Arthur, 

    You can't assign a sequence number as you normally do for Product number or PIH/SIH document numbers.

    But you can programmatically get the next number from a sequence and use it to fill your field value.

    You can use the function NUMERO just like this example.

    Call NUMERO (NOME_CONTADOR, ESTAB, [0/0/0], "", CONTADOR, STAT) From SUBANM

    http://online-help.sageerpx3.com/erp/11/staticpost/get-a-sequence-number-value/

  • 0 in reply to FormerMember

    Perfect, I get it! Thank you so much for your kind answer.

    And in another way, changing the scope... If I change the idea of sequential numbers to status based, for example, I have a custom table with two columns, number and status, and every new record, such as a new Purchase Invoice-record, the system will automatically get the value from this table which has the status "Current" and fill in a custom field located on the Purchase Invoice screen. Only in new records.
    In other words, it would be possible to bring a value from other table based on a criterion triggered for new records?

    Thank you again,

    Regards,