Scenario:
1. Create invoice from Packing slip
2. Enter values in these custom fields
3. Click OK to post invoice
Requirement:
I want these values to be saved on CustInvoiceJour after posting.
I understand SalesParmTable is a parameter table and custom fields are not copied automatically.
What is the correct and upgrade-safe way to pass these values to CustInvoiceJour?
Which class/method should I extend (Chain of Command)?
Is SalesFormLetter_Invoice.updateInvoice() the right place?
Any best practice or recommendation is appreciated.
I solved this by updating CustInvoiceJour after posting in
SalesFormLetter_Invoice.afterOperationBody().
Values entered on the invoice posting dialog are stored in SalesParmTable.
After posting, I read the posted invoices from
formletterOutputContract.parmAllJournalsPacked().
Important note:
The CustInvoiceJour buffer from parmAllJournalsPacked() cannot be updated
directly because it belongs to another transaction scope.
Therefore, I re-select CustInvoiceJour using select forUpdate in my own TTS
before updating custom fields.
This is the final approach I used:
- Hook: SalesFormLetter_Invoice.afterOperationBody()
- Source: SalesParmTable (custom fields from posting dialog)
- Target: CustInvoiceJour (re-select by RecId, then update)
This works correctly for invoice from packing slip, batch posting,
and follows X++ transaction rules.
1 people found this reply helpful.
Was this reply helpful?YesNo
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.