Steve
There are a number of ways to accomplish this. One that comes to mind:
This article will give you an overview of error handling and transactions: https://docs.mendix.com/howto/logic-business-rules/set-up-error-handling
Hope that helps,
Mike
Note: you may wonder why I didn't recommend that you set error handling in the loop while committing each NewOrderItem. In Mendix, you cannot set custom error handling directly inside of a loop. So while an error in the loop will have the effect of rolling back all of the objects created in the whole microflow, it won't be very graceful - the user will get a message that says, "An Error Has Occurred". Committing a list of objects after the microflow enables you to handle an error in a more orderly fashion. Another way to use custom error handling in a loop is to put the Commit in a microflow which you call in the loop instead of committing directly in the loop. Which you use is personal preference, I think, unless your list of items is large in which case committing the list of NewOrderItems after the loop has a significant performance advantage over committing each item as it is created.