Skip to main content

Notifications

Microsoft Dynamics AX forum
Unanswered

Event handlers on sales invoice posting in batch mode

Posted on by 2

I need to trigger a custom process to run after the posting of sales invoices in batch.

I have not been able to find a suitable place to put the event handler to trigger this code.

Has anyone used event handlers on sales invoice posting process in batch mode (with multi-threading).

Where is the best place to put the event handler?

Categories:
  • ciarand Profile Picture
    ciarand 2 on at
    RE: Event handlers on sales invoice posting in batch mode

    AX2012 R3.

    I put the event handler on the SalesFormLetter_Invoice.afterOperationBody() this code only runs on client, batch mode does not run this code (verified with trace parser)

    It runs the FormLetterServiceMultithread class but can determine where to put event handler for the batch mode to only trigger for sales invoicing

  • nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Event handlers on sales invoice posting in batch mode

    Is your question about Dynamics AX (2012) or Dynamics 365 for Finance and Operations?

    Anyway, it should not matter if it's run in batch or not, it runs through the same code. And then you can find out in your event handler if the code is running in batch or not.

    In AX2012 you would call clientKind() method.

    In D365FO you would call hasGUI() method.

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,142 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,979 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans