Hi,
I’m a developer working with Dynamics 365 data and I don't have a really good understanding about Accounting, probably this is one my problems, but anyway. I'm trying to get spending data from companies, I've started with Invoices and I just need totals per headers and lines, a constraint that I have though that has been hard to solve for me is that I need the Invoice Accounts and the Main Accounts as details, so for instance, for a specific invoice I want the totals per Vendor but also the Main Account per each invoice line, I don't care about the taxes at the moment, so just the totals excluding taxes.
I've been trying to pull in fields about Invoices from the VendInvoiceJourBiEntities, VendInvoiceTransBiEntities, GeneralJournalEntryBiEntities, GeneralJournalAccountEntryBiEntities tables—because I can see that I can get the Main Accounts from GeneralJournalAccountEntryBiEntities, but it looks like they are aggregated already so I can't link them back to the invoice lines and connect them.
Could anyone guide me on how to implement this? Which key fields or relationships should I use to ensure accurate data mapping? At the moment I'm focusing in just doing this with the entities that I have access by default, but if is not possible to get this information maybe I should create a specific view for this?.
Thank you in advance for your help!