0

Change the Script on the Autmatic Creation of Order Number in the Bult in Order Databse

Help please. I am a very basic user of Ninox and I would like to make a change to the script that triggers the creation of an order number on creation of an order record. I know what I wasnt to do but I can't find the script to adjust. I have a basic package. Any help would be great! Thanks

1 reply

null
    • sebastian
    • 3 yrs ago
    • Reported - view

    Do you mean to create automatically an order number of a record?

    If you want to this then, input formula into "trigger on create" of the table with your records.

    For example: Order Numbers in sequence Letter+Date+n -  "O-"+YYMMDD## => O-21020501, O-21020502 .......

     

    Formula:

    let myOnr := (select 'Order Table')['Order No.' like "O-" + format(today(), "YYMMDD")].substr('Order No.', 2);

    let mytodayNr := number(max(myOnr));

    if number(myOnr) < 18070301 then

    'Order No.' := text("O-" + number(format(today(), "YYMMDD")) + "01")

    else

    'Order No.' := text("O-" + number(mytodayNr + 1))

    end;

Content aside

  • 3 yrs agoLast active
  • 1Replies
  • 450Views