Context
-
Printing is triggered after posting from
SalesInvoiceJournalPrint.printJournal(Set _journalList)(extension). -
I can print my custom report successfully after posting.
-
I also added a manual print button on
CustInvoiceJournal(multi-select) and it works.
Problem
-
In Thai localization, I found
CustInvoiceTableExtensionTH.NoteFormat(enumTaxUnrealizedSalesNoteFormat) which can indicate CN/DN. -
However, for many posted invoices created from Sales order “Credit invoicing”,
CustInvoiceTableExtensionTH.NoteFormatis empty/None, but the standard output still prints with “Credit Note” title. -
Therefore,
NoteFormatis not populated in all flows, andNumber sequenceis not reliable.
Questions
-
In standard D365FO, what is the correct source of truth to decide “Invoice vs Credit Note vs Debit Note” for sales invoices?
-
Which table/field does standard logic use (e.g.,
CustInvoiceJour.InvoiceAmountsign,CustInvoiceTransquantities, correction/reversal flags, references to original invoice, etc.)? -
For Thai DN/CN documents: is there a standard field (or doc type) that is always set for DN (not just “amount > 0”)?
-
Is there a recommended API / method to reuse (e.g., a standard method that returns the document title/type, similar to
SalesInvoiceContract.parmDocumentTitle()or something inSalesFormLetter_Invoice/SalesInvoiceJournalPrint)? -
If
NoteFormatis only used by some TH scenarios, when is it supposed to be populated, and by which class/table update? -
Best practice for custom report header: should we implement a fallback like “if NoteFormat empty -> use amount sign for CN, otherwise use NoteFormat for DN/CN”, or is there a better approach?
Any pointers to the exact class/method names or a pattern you have used would be greatly appreciated.


Report
All responses (
Answers (