Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Multithreading/SalesFo...
Finance forum
Suggested answer

Multithreading/SalesFormLetter in D365

Posted on by 217

Hi,

I want to know I have found this code snippet in AX2009 for multithreading in batch processing in SalesFormLetter class. Can anyone tell me in which class same functionality is performed in D365 for multithreading. I also found that salesFormLetterEndMultiThread has been depreciated in D365. What is used instead? I also want to know I want to add some custom code to execute in salesformletter in between of a process but in D365 we have only Pre and Post Eventhandlers. And FormLetterservice is responsible for posting journals. What would be my starting point If I want to generate two Invoice journals with respect to lines.  

Urgent help is highly appreciate able. Thanks in advance.

if (this.canMultiThread())
{
    batchHeader = BatchHeader::construct(this.parmCurrentBatch().BatchJobId);
    salesFormLetterEndMultiThread = SalesFormLetterEndMultiThread::newFormLetter(this,
                                                                                 salesParmUpdate.ParmId,
                                                                                 salesParmUpdate.Proforma);
    batchHeader.addRuntimeTask(salesFormLetterEndMultiThread,this.parmCurrentBatch().RecId);
}




if (batchHeader)
{
    formLetterMultiThread = FormLetterMultiThread::newFormLetter(this);
    batchHeader.addRuntimeTask(formLetterMultiThread,this.parmCurrentBatch().RecId);
    batchHeader.addDependency(salesFormLetterEndMultiThread,formLetterMultiThread,BatchDependencyStatus::FinishedOrError);
}
  • Blue Wang Profile Picture
    Blue Wang on at
    RE: Multithreading/SalesFormLetter in D365

    Hi @NoMe,

    SalesDormLetterEndMultiThread has depreciated in D365.

    You can learn about these two classes.

    PurchFormLetterEndMultiThread Class : https://docs.microsoft.com/en-us/previous-versions/dynamicsax-2009/developer/cc636538(v=ax.50)

    FormletterServiceMultithread Class : https://docs.microsoft.com/en-us/previous-versions/dynamics/ax-2012/application-classes/gg754529(v=ax.60)

    I hope it will help you.

  • Suggested answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,643 Moderator on at
    RE: Multithreading/SalesFormLetter in D365

    You can use Chain Of Commands feature for your customizations.  Also note you can not add code in between , in short you can not avoid execution of standard code . If your method  has some parameters which you can manipulate , there is possibility to avoid some code based on how they are used.  FormLetterframework is responsible for lot of posting related to SO , PO etc.. If you are talking about journal posting You should look at classe JournalCheckPost .

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Multithreading/SalesFormLetter in D365

    try SysOperationFramework

    great source here

    devmusings.blog/.../sysoperation-framework-cheat-sheet

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans