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
-
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
-
Ok. Thanks. Long life to NINOX
-
Jorg,
You solution will increment after every FIELD update. You should use the trigger after create.. not update..
-
Ok that work perfectly. Thanks
-
Hi Michael,
Yes you are absolutely right, I told the wrong trigger name.... thanks that you kept your eyes open...
Best, Jörg
-
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!
-
"No worries".... Geez.. having a hard time typing.. LOL..
-
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 + 1What I'm doing wrong?
-
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.
-
Sorry. The field that should be a "Number" is if course 'Order No.'. Should not write anything before the morning's coffee.
-
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
- 4 yrs agoLast active
- 11Replies
- 2233Views