Invoice Items Auto Numbering

Marc_Dillon:

Devo leggere tutto questo thread o puoi indicarmi un post?

[Invoice Items Auto Numbering](https://community.appsheet.com/t/invoice-items-auto-numbering/62242/11) Questions

I’ll explain the more complex process to avoid that the rows could be assigned the same serial number. creates a (non-virtual) column of datetime type es. “sort” (ignore seconds disabled) then create a virtual column with COUNT(SELECT(ORDER ITEM [ORDER ITEM ID], AND ([ORDER ID] = [_ THISROW]. [ORDER ID], [SORT] <[_ THISROW]. [SORT]))) + 1 now create a behavior (not display) in order item: set the values ​​… column “sort” = NOW() in order item_form (ux) insert the behavior as when form saved …

1 Like

Invoice Items Auto Numbering:

(ignore seconds disabled)

Why ignore seconds?

Invoice Items Auto Numbering:

now create a behavior (not display) in order item: set the values ​​…> > column “sort” = NOW()> > in order item_form (ux) insert the behavior as when form saved

What’s the point of this? Why not just record NOW() in the column as initial value?

Invoice Items Auto Numbering:

then create a virtual column with COUNT(SELECT(ORDER ITEM [ORDER ITEM ID], AND ([ORDER ID] = [_ THISROW]. [ORDER ID], [SORT] <[_ THISROW]. [SORT]))) + 1> …> template> <

It’s a clever expression to adjust the serial ordering based on the timestamp. I wouldn’t use it in a virtual column on a line item or transactional table though, as there’s likely to be many records in such tables and this would hurt sync times. In-app, you can always just sort by the timestamp anyways, so you don’t really need the serial number.

It’d be totally fine in a template though.

1 Like

1- I meant seconds activated

2- for the highest possible accuracy. if two or more users enter orders

3- the virtual column is used to automatically set the order number in case you delete one of these