Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Multithreading/SalesFo...
Finance forum

Multithreading/SalesFormLetter in D365

(0) ShareShare
ReportReport
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
    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
    71,682 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
    on at
    RE: Multithreading/SalesFormLetter in D365

    try SysOperationFramework

    great source here

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

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,017 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans