Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Relationship between the VendInvoiceInfoTable and TaxTrans tables

Posted on by 45

Respected

I need to find a relationship between the VendInvoiceInfoTable and TaxTrans tables or, failing that, which tables I need to relate in order to do it.

Your help please

Thank you

*This post is locked for comments

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    Could you please mark any answer(s) that helped you as verified to close this thread ?

  • Josan_ec Profile Picture
    Josan_ec 45 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    Thank you very much, this is what I needed.

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    Here you go

    PurchTotals purchTotals = PurchTotals::newParmTable(vendInvoiceInfoTable, PurchUpdate::All, AccountOrder::None, vendInvoiceInfoTable.ParmId, '', DocumentStatus::Invoice);
    purchTotals.calc();
    tmpTaxWorkTrans = purchTotals.tax().tmpTaxWorkTrans();

    You need to set PurchUpdate and DocumentStatus you want.

    Now SourceTableId == VendInvoiceInfoLine.TableId and SourceRecId== VendInvoiceInfoLine.RecId

  • Josan_ec Profile Picture
    Josan_ec 45 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    Thanks again, but my interest is to take the tax by invoice and the PurchTable is only the Purchase Order, so my need to tie it with VendInvoiceInfoTable or VendInvoiceInfoLine.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    I just checked cross-references and there is no code to populate this field. Looks strange but anyway you can join them using PurchLine that you can find from VendInvoiceInfoLine , there is a relation TmpTaxWorkTrans.SourceRecId  == PurchLine.RecId && SourceTableId.TableId == PurchLine.TableId

  • Josan_ec Profile Picture
    Josan_ec 45 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    Thanks for your answer, I already filled the TmpTaxWorkTrans table but the VendInvoiceInfoLine field has value 0 in all records and I can not relate it to the VendInvoiceInfoLine table ... any idea?

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    Yep, that's what we do as developers. Anyway you can try to use

    PurchTotals::getTax(purchTable).tmpTaxWorkTrans();

    This method returns temporary table that contains all tax transactions for purchase order.

  • Josan_ec Profile Picture
    Josan_ec 45 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    This form uses classes and several methods for accessing data, it is complicated to follow the trail.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    For not posted order you can find tax information in TaxUncommitted table. You can put breakpoint into \Data Dictionary\Tables\TmpTaxWorkTrans\Methods\loadFromTaxUncommitted  to see how AX selects data when you click totals on unposted invoice. Generally speaking it's done base on SourceDocumentRecord.

  • Josan_ec Profile Picture
    Josan_ec 45 on at
    RE: Relationship between the VendInvoiceInfoTable and TaxTrans tables

    Thanks for replying, I explain a little better what I need:

    In the Form VendEditInvoiceTotals are shown totals of a Purchase Order, I need to show the tax breakdown. That Form uses the VendInvoiceInfoTable as Data Source.

    Can you tell me what to do?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans