Getting VAT amount on a sales line

Are there any ways of getting the correct VAT amount (taking any kind of discount into account) on a sales line? The 2 fields on the salesline “Amount” and “Amount including VAT” would do the job if they could be populated in some ways…

Hi Jens, you need to use the function “CalcVATAmountLines” in the sales line. this is somewhat complicated, in fact you have to do the same things as if you open a statistics window for the sales order or release the sales document. Unfortunally, there is no “easy” way to get the VAT amount as it is only calculated on showing the statistics window or on releasing the document. with best regards Jens

I’ve found another solution: I needed the VAT amount on a new version of report 202. If you take a look at trigger code on ‘Copyloop - OnAfterGetRecord()’ you will discover that the temp-sales lines has the information!

Hi Jens, we both mean the same :slight_smile: It’s basically the same code. I have made a codeunit with it for use at various opportunities. greetings Jens