Hello
Im working on an app to create new selling orders. It works as a shopping cart.
The thing is that I am saving the information on Sharepoint List, every item is a new line on the List.
But 1 order may have 5 items inside, so on the list I will have 5 lines, and I want all of them to have the same order number.
Finally, I need to execute this action at the end of the process, since different users will use the app at the same time, I cannot create the ID when I create the item, I need to do it when I send the order confirmation.
The Items added to the order are managed inside a collection.
Basically I need to: check the last order number (I do it with first-->sort.descending), and then with a for all (or something like that), add that number to all the collection (must always be the same number) and add the collection to the list.

Example picture, the "number order" it is under the tag "Numero de Pedido".
Thanks,
Pablo