increment number automatically

62 views
Skip to first unread message

bourah...@gmail.com

unread,
Dec 4, 2022, 10:16:42 AM12/4/22
to Jam.py Users Mailing List
 hello is there a way to increment number automatically from the last record number 
merci

Sans titre.png

Drazen D. Babic

unread,
Dec 5, 2022, 1:23:50 AM12/5/22
to Jam.py Users Mailing List
Hi, on_after_append is a Client JS, what happens when someone else updates the record?
I think the Server Side code is needed (check DEmo  Journals/Invoices ) :
def on_apply(item, delta, params, connection):
.
.

Drazen D. Babic

unread,
Dec 8, 2022, 9:04:16 PM12/8/22
to Jam.py Users Mailing List
User tried this, but failing:
def on_apply(item, delta, params, connection):
    if item.field_by_name('reference'):
       for d in delta:
            d.last()
            d.edit()
            d.reference.value = reference.value +1
            d.post()

The suggested way is d.reference.value +1
Reply all
Reply to author
Forward
0 new messages