Notifications
Announcements
No record found.
Context
Printing is triggered after posting from SalesInvoiceJournalPrint.printJournal(Set _journalList) (extension).
SalesInvoiceJournalPrint.printJournal(Set _journalList)
I can print my custom report successfully after posting.
I also added a manual print button on CustInvoiceJournal (multi-select) and it works.
CustInvoiceJournal
Problem
In Thai localization, I found CustInvoiceTableExtensionTH.NoteFormat (enum TaxUnrealizedSalesNoteFormat) which can indicate CN/DN.
CustInvoiceTableExtensionTH.NoteFormat
TaxUnrealizedSalesNoteFormat
However, for many posted invoices created from Sales order “Credit invoicing”, CustInvoiceTableExtensionTH.NoteFormat is empty/None, but the standard output still prints with “Credit Note” title.
Therefore, NoteFormat is not populated in all flows, and Number sequence is not reliable.
NoteFormat
Number sequence
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.InvoiceAmount sign, CustInvoiceTrans quantities, correction/reversal flags, references to original invoice, etc.)?
CustInvoiceJour.InvoiceAmount
CustInvoiceTrans
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 in SalesFormLetter_Invoice / SalesInvoiceJournalPrint)?
SalesInvoiceContract.parmDocumentTitle()
SalesFormLetter_Invoice
SalesInvoiceJournalPrint
If NoteFormat is 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.
isCreditNote = custInvoiceJour.InvoiceAmount < 0 || (custInvoiceJour.InvoiceAmount == 0 && custInvoiceJour.Qty < 0);
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 704 Most Valuable Professional
André Arnaud de Cal... 570 Super User 2025 Season 2
BillurSamdancioglu 408 Most Valuable Professional