web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Is there existing method to calculate sales tax amount?

(0) ShareShare
ReportReport
Posted on by 596
Hello guys,
 
I'm creating retail transaction which kinda similar of Sales Order using X++, I'm wondering whether there is existing method I can use to calculate sales tax amount that I can re-use ? This retail transaction (can say it is per item line similar like Sales Line records) will be used to create Sales Order later on, but I need to calculate the tax amount first to display it before it is getting converted to Sales Order.
The challenge here is I supposed to not hard-code the tax rate, but to look at SalesTaxGroup and ItemSalesTaxGroup, also I need to consider if the Price is include sales tax.
 
So basically, if I only have this kind of information:
1. Sales Qty
2. Sales Price
3. TaxGroup
4. ItemSalesTaxGroup
5. flag to identify IsPriceIncludeTax
 
How to easily calculate the tax amount ?
It is very good also if the method can also considering line discount but this is not a priority at the moment.
 
Thanks
 
 
 
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,897 Super User 2025 Season 2 on at
    Is there existing method to calculate sales tax amount?
    Hi Voltes,
     
    You can check if you can call the TaxCalculation class which has the logic.
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Is there existing method to calculate sales tax amount?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 734 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 636

#3
Martin Dráb Profile Picture

Martin Dráb 553 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans