Correct approach for temporary things

Hi there,

I was wondering if I have the correct approach for the following use case. When I can do this more efficient please let me know.

Use case:
User is creating a work order and all in one screen the user is filling in some order generic data and the user is adding orderlines. When order is submitted the work order is saved and orderlines are linked to the work order.

I specifically want to know the best practice in adding orderlines to an order that not yet exists.

Planned Approach
On the order entry screen I have a group that has a custom state (a list of order lines). A button " add order line" toggles a pop-up with required inputs. On save I create a orderline thing with a status of “concept” I also add this orderline to the custom state.

A repeating group is showing all the orderlines which are in the customer state.

On submitting the order itself. I create a work order thing. Then I want to make a change on a couple lists of things:

  1. Add the orderlines list from the custom state to the orderlines list of the work order
  2. Update status of all these orderlines from “Concept” to “Definite”. This to be able to cleanup all concept orderlines older than one day.
  3. Link the created work order as work order to each orderline (reverse relationship)

So is the the best approach to follow and is this possible? I tried to append the custom state without creating a thing for each orderline but that was not possible.

Thanks already!

Screens of your data setup and I’ll help you if I can. I don’t understand what you’re saying with “orderline” and order.