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

Announcements

No record found.

News and Announcements icon
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
 
 
 
  • André Arnaud de Calavon Profile Picture
    308,216 Super User 2026 Season 2 on at
    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 274 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 213

#3
Subra Profile Picture

Subra 202 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans