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
    300,721 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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans