Hello,
I am trying to add a way to calculate taxes of a order product as its added without having to use a Power Automate flow in the background.
The new "add products" experience I'm talking about: https://docs.microsoft.com/en-us/dynamics365/sales-enterprise/add-products-enhanced-experience.
Normally, to calculate taxes would be pretty straight forward. When the user is on the Order Product form they put in a product, and with some JavaScript calculate the taxes on the fly. The problem now though is that you never actually get into that Order Product form when using the new experience. The Order Products are all added as line items and you never actually see the Order Product form. That leaves me in a situation now where I need to calculate the taxes still without the user actually going into the form.
I've created a calculated field on the Order Product table that calculates the taxes perfectly. Its visible as soon as the Order Product is added. The problem is that the totals of the Order are not looking at that custom tax field. They are looking at the OOB "open number" tax field.
What I've done:
- Power Automate flow. Not idea as the user now needs to wait for it to run and refresh the form for the Order totals to reflect the changes to the tax field make by the Power Automate flow
- Cant use a workflow. I am unable to select update on the Order Product within a workflow
- Entity level business rule to copy over the tax from the calculated field to the OOB tax field so the order totals can pick it up (works kind of. It copies over the value 0 instead of the real value of the calculated field. My guess is that is calculated field hasn't actually been calculated yet at the time the business rule runs)
Would prefer not to use plugins as that seems like overkill for something like this but if that is the only solution than it may have to be done.
Any ideas on how this can be done. I am trying to avoid the user from ever having to hit refresh OR wait for a flow to calculate the taxes in the background. They sales reps make actual payments using CCs directly on the order form so it is very important the totals are accurate so they customer is charged the proper amount.