*** NOTE: ALL INFORMATION IS ACCURATE AT DATE OF PUBLISHING ***

Some may argue (and they have! πŸ™‚ ) that tax should never be calculated in Dynamics 365, and should only be used in a finance package. I would tend to agree from the point of view of an order/invoice, but a sales organisation using D365 is probably using the Opportunity & Quotes entity and needs to create a quote document to send to prospects and clients. So, therefore, there are situations when the tax needs to be displayed and calculated within D365. In the UK tax (or VAT) is calculated at 20%. So how do we get this on the Quote record (we will use this as the example)?

Each time a new quote line item is added, the Total Tax line on the main quote is a sum of the tax field on all of related line items. Trying to create a business rule or workflow on the quote entity to calculate the 20% is futile, as the record will continue to calculate that field using standard out of the box code, and go back to the sum of tax on the mentioned line items. You can see the tax field below on a line item is just empty. You could manually type something in, but who has time for that?

So, let’s set up a business rule to help us out. This will be created on the quote product entity. The scope should be set as Entity. If you set it to run on a form it will only run when the form is open, which again is a huge time waster for the end user. Running it on the Entity will make sure it runs each time a new quote line is added to the main quote record.

Next, we will set the Condition to make sure the Price Per Unit field contains data, then add a set value step to calculate the tax.

The value will be a formula run on the Tax field. This will be the Amount field multiplied by 0.20. This will give us 20% of the amount on the quote line.

Now go ahead and add a new quote line to your quote. You should see the tax value automatically calculated.

This will then update the Total Tax field on the main quote.

Finally, lock down the tax field on the quote product record by making it read only. This will make sure it can only ever be calculated using the business rule. Keep in mind if you start from an Opportunity you will need to set up the same business rule for calculating tax there, or if you go straight to an Order you might need to add the business rule there. Now you can display the tax on any word documents you might create for quotes.

 


Check out the latest post:
Removing Issues With Mobile Phone Numbers On Realtime Forms


This is just 1 of 447 articles. You can browse through all of them by going to the main blog page, or navigate through different categories to find more content you are interested in. You can also subscribe and get new blog posts emailed to you directly.




5 thoughts on “Calculate Total Tax On Opportunities, Quotes & Orders From Related Line Items

  1. Hi Megan,

    Thank you for providing these instructions – this looks exactly like that I want to do!

    However, I’ve noticed a small problem regarding “The scope should be set as Entity. If you set it to run on a form it will only run when the form is open, which again is a huge time waster for the end user. Running it on the Entity will make sure it runs each time a new quote line is added to the main quote record.”

    I am running the business rule with the entity scope on the ‘quote product’ but I’m finding that it does not fire each time a new quote line is added, instead it only fires when I click into each quote line individually to open the form.

    This means I have to add products to my quote, then individually double click to open each product form in order to get the tax field to calculate.

    I am running the same business rule that you have above, on the ‘quote product’ entity with the scope set to entity.

    Did you encounter a similar problem or do you have any advice to overcome this? I’m not sure if I’ve missed something.

    Many Thanks

    1. Regarding my earlier comments about the business rule not triggering until the form was opened… for us at least we resolved this by using the ‘Extended Amount’ field instead of the ‘Price Per Unit’ field. After changing the fields in the business rule the tax calculates automatically without having to open the forms.

    2. Thanks for posting your resolution. Glad you were able to sort it out. ????

  2. I encountered the same issue as D Newton and the same resolution worked.

    Many Thanks to you both.

Comments are closed for this post.