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

Announcements

No record found.

News and Announcements icon
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?

(4) ShareShare
ReportReport
Posted on by 317
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
    317 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.

     
  • Suggested answer
    Komi Siabi Profile Picture
    13,190 Most Valuable Professional on at
    You could also extend initFromSalesParmTable method from the CustInvoiceJour table.
     
        public void initFromSalesParmTable(SalesParmTable _salesParmTable)
        {
            this.YourField1 = _salesParmTable.YourField1 ;
            this.YourField2 = _salesParmTable.YourField2;
    
            next initFromSalesParmTable(_salesParmTable);
        }
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 577 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 309

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans