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
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
Could you please mark any answer(s) that helped you as verified to close this thread ?
Thank you very much, this is what I needed.
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
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.
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
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?
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.
This form uses classes and several methods for accessing data, it is complicated to follow the trail.
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.
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?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156