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 :
Microsoft Dynamics AX (Archived)

How to change cust invoice values before posting (AX2012)?

(0) ShareShare
ReportReport
Posted on by 540

Hi,

I'm a little confused... How to change CustInvoiceJour record values before posting an invoice from  all sales orders form?

There was SalesFormLetter_Invoice.initJournal() method in AX2009 that invoked  CustInvoiceJour.initFromSalesTable() method. Using initFromSalesTable record values could be changed...

Even Though initFromSalesTable() method still exist it does't get invoked fo from SalesFormLetter_Invoice.

How I can change CustInvoiceJour buffer values before inserting it to the table.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Andrew Xu Profile Picture
    3,877 on at

    You can do that in the class 'SalesInvoiceJournalCreate', the method 'initJournalHeader' initializes the data of CustInvoiceJour.

  • Justinas Ringaila Profile Picture
    540 on at

    Unfortunately debugger doesn't jump to this method.

  • Verified answer
    Andrew Xu Profile Picture
    3,877 on at

    The reason why your break point in that class was not hit is that that class is called via IL, but not X++. This is new in AX 2012. For the performance aspect, this enhances the performance, because IL is ran by .net frame work. But the side effect is that X++ break point won't work in that code.

    To enable your debugger for that kind of code, you need to execute the code via X++, please see axinsighter.blogspot.com/.../devtricksfornondevelopers02.html.

    For your specific issue, you need to do that in class 'SysOperationRPCFrameworkService' to change the method 'runServiceOperation' to,

    public static container runServiceOperation(ClassId controllerClassId, container packedController)
    {
        return SysOperationServiceController::runServiceOperation([controllerClassId, packedController]);
    }

  • Justinas Ringaila Profile Picture
    540 on at

    Thanks, you helped me а alot :)

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans