How to prevent two order details with the same product in an order capture app?

Hi everyone,
I am trying to reproduce a similar app to the template ‘order capture’ app.
But, I want to avoid the same product with two details in an order. Instead, if I add a same product to the order details, I would like to add the new entry’s quantity to old entry, and then omit the new entry.
How can I set it up? Thanks in advance.

There are fews ways to achieve your goals, but I will select option to set your child table key field expression to be something like Concatenate([ChildKey],[ProductName]) to avoid the duplicate entry with the same product is pushed to the same parent (order).

1 Like

Thank you for your quick reply.
I thought about such setup. But, my friends say that it would not be enough for their fast-paced work.
They need the app to automatically do the calculation without them having to edit the old entry. Do you think it would be possible to meet their expectation? Thanks again.

you create custom action on the parent table to add or edit the child record.
This is one deeplink action.
if the newly added child record with the product name same as the existing child record, then you prompt to the user to the same existing child recoord form view using linkedtorow expression.
If not, then just opnen up new entry form.

3 Likes

Thanks a lot. I guess that would be the best solution if not the automatic calculation one.

1 Like