Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Transaction Import - How can we update OrigDocAmount after Tax is calculated

(0) ShareShare
ReportReport
Posted on by

We've implemented an invoice import process that using Transaction Import.  Currently, the process is passing in 2 line items, 1 for the sales item and 1 for sales tax that was calculated by the source system.  We are also passing the OrigDocAmt as the sum of the item and tax.  The result is a balanced invoice.  We are trying to replace the tax item with a call to AvaTax to perform the Tax calculation.  We have installed a connector for AvaTax and it is successfully calculating sales tax and storing it on the invoice, however the OrigDocAmt is not updated.  

We are importing over 500 invoices and it is not possible to touch each invoice to update the OrigDocAmt manually.  Is there a way to get the import process to update the OrigDocAmt after the tax call is completed?  We took out passing the OrigDocAmt in the file and control file, but that just results in an amount of zero.

The Avatax call is made upon Save.  After the save is complete, the DocBal and CuryDocBal includes the sales tax.  It would seem that the control file needs to set the OrigDocAmt to the DocBal and initiate another save.  

Can someone explain how I might do this in the intelligent control file?

*This post is locked for comments

  • Suggested answer
    Apps Mexico Profile Picture
    1,090 on at
    RE: Transaction Import - How can we update OrigDocAmount after Tax is calculated

    Hi,

    I don't know how works the Avatax connector, but after that the avatax calculates the taxes you could try to update the CuryDocBal with code. You could try on the distinct levels LEVEL0, Finished, etc.

    Private Sub Update1_UpdateEvent(Level As Short, InsertFlg As Short, LevelsDone As Short, LevelsLeft As Short, ByRef RetVal As Short) Handles Update1.UpdateEvent
    If IS_TI = True Then
    If Level = Finished Then
    Call SetBufferValue("bAPDoc.CuryDocBal", vNewCuryDocBal)
    Call Edit_Save()
    End If
    End If
    End Sub

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans