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

Modify "Total Actual Sales Tax Amount" programmatically upon opening TaxTmpWorkTrans form

(0) ShareShare
ReportReport
Posted on by 40

Hi,

When we are in sales order list, upon clicking a sales order and choose SELL tab on the top bar > Sales Tax, we want to plug in/populate value for the Total Actual Sales Tax Amount field without having the user to type into it. How do we do that?

So far we have tried to inject the value before the tax regulation field being populated, but the value still does not get changed.

 

[PreHandlerFor(formStr(TaxTmpWorkTrans), formMethodStr(TaxTmpWorkTrans, taxRegulationTotalCur))]
public static void TaxTmpWorkTrans_Pre_taxRegulationTotalCur(XppPrePostArgs agrs)
{
boolean set = agrs.getArgs('_set'); //get boolean check whethe we will use regulated/custom tax or not.
TaxRegulationAmountCur taxRegulationCur = args.getArg('_taxRegulationTotalCur'); //get field
set = true;
taxRegulationTotalCur = 19.00;
}

We also attempted with other methods like initTmpTaxRegulationValue, etc. witthout success.

Any insight of how to do this would be very appreciated!

Thank you guys in advance,


TN

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    Hi TN,

    Can you explain the scenario? Did you setup all Tax codes with Tax Groups and tax groups for items which can do the tax calculation for you automatically? Looking at your coding, why is there a hard coded value of 19.00?

  • ThienNgo Profile Picture
    40 on at

    Yes, we do have all the tax codes and tax groups set up. However we want to use a third party api to do calculation and plug that value in instead (which acts as if we adjust the tax amount after all the calculations have been done).

  • Suggested answer
    Junaid Idrees Profile Picture
    on at

    what is the triggering point to calculate the tax amount from your 3rd Party API?  While selecting Product or Save the Sales Order? The default system behavior is when we select the product and if that is linked to any Item sale tax group with X %, system calculate the "Total calculated sales tax amount" in SELL >> SALES TAX SCREEN so if we want to override that calculated sales tax value, we just enter the new value in "Total actual sales tax amount" field and system takes that new value while posting invoice and also for tax reporting.   Please also consider the scenario where you can have orders in multi currencies.

    Please also help to mark this thread as answered if your query is also answered as well.

  • ThienNgo Profile Picture
    40 on at

    We want to trigger it in the Sell > Sales Tax as you mentioned.

    We want to do it "programmatically," which method/event should we plug our code after so we can fill in the "Total actual sales tax amount" field automatically?

  • Suggested answer
    Junaid Idrees Profile Picture
    on at

    You can trigger it once sales order is confirmed. Considering the fact that user can modify the sales order price of that line item (if you are not using price agreement) so you have to recalculate tax amount. You should keep all the scenario's in mind before you automate such business logics.

  • ThienNgo Profile Picture
    40 on at

    Hi Junaid,

    I am sorry, but I am still confused as your reply does not really answer my question. Which is the exact method in the TmpTaxWorkTrans form I need to look at to automate that logic?

    Apparently what we want to do is that we want to treat the value from 3rd party API as an adjustment, and use that value instead. We have been using their product for a long time so we do not think there will be any problem.

    Thanks in advance,

    TN.

  • Suggested answer
    Junaid Idrees Profile Picture
    on at

    Hi ThienNgo,

    Yeah i understand your requirement but i won't be able to help you from technical coding prospective because I am working as functional architect.

    @Andre can assist you which method/class you should use to trigger that logic we discussed above.

  • ThienNgo Profile Picture
    40 on at

    Hi,

    Is there any update?

    Thank you in advance,

    TN

  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    Hi Thien,

    I wonder why you want to open the form to trigger the third party tax calculation. I also wonder why you need that third party tool anyway. Is there any calculation logic missing in the standard application?

    Usually when a line is saved, all tax values are calculated automatically. You can probably find that logic and then call your third party tool. I think that would be a better place. Otherwise, if users will not open the Sales Tax form, the logic will not be triggered.

  • ThienNgo Profile Picture
    40 on at

    Hi,

    It's a decision from the higher-up.

    Back to your saying, so I can use the third party tool to auto-calculate the Adjusted Tax amount for the line, and force the system to override and use that amount instead of the calculated one provided by the standard application, right?

    Thank you,

    TN.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 616

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 460 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 331 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans