0

incrementation

hello, I am not at all expert in programming but I will only wish to create the incrementation of a variable when I create a new line. my level in English being very reduced 'I have trouble following tutorials. Thanks for your help. greetings   I use Google translator...

11 replies

null
    • Jorg
    • 5 yrs ago
    • Reported - view

    Hi, 

    you can use a formula like the following in the table option "Trigger after update".

     

    let myvariable := max((select Table1).Variable);
    Variable := myvariable + 1

     

    In that example you have a Table with the name Table1 and a field "Variable". Everytime you create a new record, Ninox searches for the highest Variable and adds 1 to write the result into the field of the new record.

    Best, Jörg

    • re_66helene66
    • 5 yrs ago
    • Reported - view

    Ok.  Thanks.    Long life to NINOX 👍👍

    • Mconneen
    • 5 yrs ago
    • Reported - view

    Jorg, 

    You solution will increment after every FIELD update.  You should use the trigger after create.. not update.. 

    • re_66helene66
    • 5 yrs ago
    • Reported - view

    Ok that work perfectly.  Thanks

    • Jorg
    • 5 yrs ago
    • Reported - view

    Hi Michael, 

    Yes you are absolutely right, I told the wrong trigger name.... thanks that you kept your eyes open... 👍🏼😉

    Best, Jörg

    • Mconneen
    • 5 yrs ago
    • Reported - view

    No worried Jorg... I do not know how you keep this all striaght.. :)   Thank you to you and the support team.. You folks are AWESOME!

    • Mconneen
    • 5 yrs ago
    • Reported - view

    "No worries".... Geez.. having a hard time typing.. LOL.. 

    • BAJABI SL
    • jjrecort
    • 3 yrs ago
    • Reported - view

    Hello All,

    I just started this afternoon with ninox, and I'm not a developer myself.

    I want to have incremental purchase numbers.

    I have implented this code found here (on trigger on create) and is literally adding a "1" to the end, so I'm geting 178 1781 17811 178111 instead of 178 179 180 ...

    let numcomanda := max((select '5_Purchase Orders').'Order No.');
    'Order No.' := numcomanda + 1

    What I'm doing wrong?

    • Alain_Fontaine
    • 3 yrs ago
    • Reported - view

    Is not the "numcommanda" field defined as a "Text" field? If you need a field to hold numbers, it should be defined as a "Number" field.

    • Alain_Fontaine
    • 3 yrs ago
    • Reported - view

    Sorry. The field that should be a "Number" is if course 'Order No.'. Should not write anything before the morning's coffee.

    • BAJABI SL
    • jjrecort
    • 3 yrs ago
    • Reported - view

    Oh! obvius, now that I see it!  Works! thanks so much! now to leard how to send a PDF with the purchase order!

    THANKS  a lot!

Content aside

  • 3 yrs agoLast active
  • 11Replies
  • 2227Views