web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to copy custom fields from SalesParmTable to CustInvoiceJour when posting invoice?

(1) ShareShare
ReportReport
Posted on by 89
Hi,
I added two custom fields on the Sales invoice posting dialog (SalesEditLines form)
and stored them in SalesParmTable:
- SalesParmTable.ShippingInvoiceDate (Date)
- SalesParmTable.ExportShippingNo (String, size 20)
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.
Thanks.
 
I have the same question (2)
  • Verified answer
    Statics 365 Profile Picture
    89 on at
    Update:

     
    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.

     

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 672 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 534 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 289 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans