Table Trigger to use after OnModify?

Hi,

I'm pretty new to the NAV Development so excuse me if I'm asking too obvious questions :smile:

I need to call .NET methods that are directly querying the NAV Data Base and doing external tax calculation for the Sales Order. The call need to be done on every modification to the Order or modification to the Order Sales Lines details.
At first I called the method from the OnModify trigger of the Sales Header and Sales Line Tables but unfortunately I have found out that the changes are still not stored in the Data Base so I can't do the calculations on the changed data.
So my question is: Is there any trigger of event that is triggered after OnModify when the data is already stored in the Data Base?

Thanks

Answers

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    The way that NAV calculates Sales Tax is not in the OnModify trigger. If you don't know NAV I would never touch Sales Tax.

    Have you looked at Avalara? Their product does what it should do but the code is horrible.

    Be careful with Sales Tax...
  • dottockadottocka Member Posts: 2
    edited 2015-10-21
    Thanks Mark.

    I have already put my code in designated place for external tax calculation implementation which is in the Code Unit 398 Sales Tax Calculate, which is executed when the Order is posted. But my client insist the calculation to be done also on any change of the details of order which is not the case by default in NAV. That's why I'm trying to init the process during the OnModify table trigger.

    Yes the Avalara is doing the same thing, I'll try to dig the solution from there.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Clients can insist, but do they understand the product well enough to know what they ask?
  • joshuasungjoshuasung Member Posts: 37
    Clients can insist to pay to break and pay to fix it again, I guess.
    They will have wonderful performance in system :)

    If you have to, you probably want to touch area where amount is getting updated.
    You probably don't want to update sales tax when customer just change the description of line.

    I would probably enforce them to default to calculate sales tax, so you can keep sales tax calculation code stay in CU398
    Joshua H Sung

    Sr. Project Manager
    S-Metric, LLC
    jsung@smetric.com
  • chavansachin20chavansachin20 Member Posts: 5
    Hi all,

    with latest releases from Avalara, code is moving toward good shape. we are incline towards Code refactor which we are considering with releases on continuous pattern. Let us know your exact need here : sachin.chavan@avalara.com.

    Thanks Mark, and nice video https://www.youtube.com/watch?time_continue=4&v=uDFvG64TkEI


    Regards
    Sachin Chavan
Sign In or Register to comment.