The Source Document Framework (Accounting Framework) will provide functionality necessary to record business events and create accounting for the newly created document – accounting distributions and subledger journal entries. But you will need to inform the framework how to deal with your document.
a) Reference source document header
- parmSourceDocHeaderTypeEnumValue(): return appropriate value from the SourceDocument_MyDocument enum you created earlier
- parmSourceDocHeaderTypeEnumName(): return the name of the SourceDocument_MyDocument enum you created earlier
See existing implementations on CustInvoiceTable, VendInvoiceInfoTable and PurchTable tables for examples related to Customer Invoice, Vendor Invoice and Purchase Order documents respectively.
b) Reference source document line
- parmSourceDocLineTypeEnumValue(): return appropriate value from the SourceDocumentLine_MyDocument enum you created earlier
- parmSourceDocLineTypeEnumName(): return the name of the SourceDocumentLine_MyDocument enum you created earlier
- parmSourceDocumentHeader(): should return corresponding SourceDocumentHeader record
- parmParentSourceDocumentLine(): should return source document line which is a parent for given source document line (for example – tax line could return its parent invoice line)
- parmExchangeRateDate(): should return date of the exchange rate for given line
See existing implementations on CustInvoiceLine, VendInvoiceInfoLine and PurchLine tables for examples related to Customer Invoice, Vendor Invoice and Purchase Order documents respectively.
c) You may need to also modify your header table to be able to act like a line if you expect any accounting related to monetary amounts on the header. In AX 2012 an example of header related amount for which distributions are being created is Round-off (VendInvoiceInfoTable.InvoiceRoundOff).
Below is a data model diagram outlining the important relationships between your tables and the framework tables:
Next - Step 3: Perform initial wiring to Source Document Framework – document classes