Using the refactored formletter framework

Similar documents
January to April Upgrade Guide. Microsoft Dynamics AX for Retail

Country-specific update for Belgium

Content Development Reference. Including resources for publishing content on the Help Server

Mapping the LedgerTrans Table to General Journal Tables

Microsoft Dynamics AX This document describes the concept of events and how they can be used in Microsoft Dynamics AX.

Microsoft Dynamics GP. Single Account Plan

System Requirements for Microsoft Dynamics AX Microsoft Corporation Published: April 2011 This content is preliminary and is subject to change.

Management Reporter Integration Guide for Microsoft Dynamics AX

GDPdU setup. Microsoft Dynamics AX White Paper

Global Address Book. Microsoft Dynamics AX White Paper

Microsoft Dynamics AX RunBase Patterns

Microsoft Dynamics GP. Inventory Kardex

Microsoft Dynamics GP. Localization Chile

Microsoft Dynamics GP. This paper provides guidance for ISV products that integrate with Inventory transaction posting.

Microsoft Dynamics AX 2012 Installation Guide

WORKFLOW. Microsoft Dynamics AX. Integration of workflow capabilities into journals

Microsoft Dynamics GP. Inflation Adjustment

Design Insights Enhanced Cue Functionality

Microsoft Dynamics NAV

Microsoft Dynamics GP. Analytical Accounting

Microsoft Dynamics GP. RapidStart Services

Microsoft Dynamics GP Professional Services Tools Library

Microsoft Dynamics AX 2012 Upgrade Guide. Microsoft Corporation Published: August 2011

Extending Microsoft Dynamics AX 2009 Default Cubes for Analytics across Virtual Company Accounts

Hardware Guide. Hardware Guide. Deployments up to 250 Users. Microsoft Dynamics NAV. White Paper. Version 1 (April 19, 2006)

Microsoft Dynamics GP Professional Services Tools Library

Dynamics 365. for Finance and Operations, Enterprise edition (onpremises) system requirements

Microsoft Dynamics GP. Multilingual Checks

What s New in BID2WIN Service Pack 4

Introduction to the SysOperation framework

OEM Preinstallation Kit Guide for Microsoft Office 2013

Microsoft Dynamics GP. Inventory Kardex

Microsoft Dynamics AX Team Server (ID Server) Setup Whitepaper for Microsoft. Dynamics AX 2009.

Microsoft Dynamics GP. Extender User s Guide

Microsoft Dynamics GP Web Client Installation and Administration Guide For Service Pack 1

Please distribute to all Spectra users in your company.

Professional Services Tools Library. Release 2011 FP1

Deploying enterprise applications on Dell Hybrid Cloud System for Microsoft Cloud Platform System Standard

Microsoft Dynamics GP Release Integration Guide For Microsoft Retail Management System Headquarters

Microsoft Dynamics GP. System User s Guide

Oracle. Financials Cloud Implementing Subledger Accounting. Release 12. This guide also applies to on-premises implementations

TOPS iq CUSTOM GRID LAYOUTS MANUAL. By TOPS Software, LLC Clearwater, FL

Audience Profile This course is intended for novice users of Microsoft Dynamics AX. Students must have basic Microsoft Windows navigation skills.

Web ADI: Extending the E-Business Suite with Desktop Applications

KwikTag T3 Release Notes

Batch Posting Service Toolkit for Microsoft Dynamics GP (build 7)

RMH PRINT LABEL WIZARD

How to plan capacity for Power BI Embedded

Subledger Accounting Reporting Journals Reports

Extending Microsoft System Center Configuration Manager with Windows Embedded Device Manager 2011

Microsoft Dynamics GP. Extender User s Guide Release 9.0

Microsoft Dynamics GP. Working With Configurations Release 10.0

Microsoft Dynamics GP. Integration Manager Quick Start

KwikTag v4.6.4 Release Notes

Batch Posting Service Toolkit for Microsoft Dynamics GP (build 8)

Application Server Release 2015

1. Determine the IP addresses of outbound servers

Microsoft Dynamics GP. Purchase Vouchers

Report Assistant for Microsoft Dynamics SL Accounts Payable Module

Microsoft Dynamics CRM 2011 Data Load Performance and Scalability Case Study

JD Edwards World. Service Enablement Guide Release A9.3 E

Oracle. SCM Cloud Configurator Modeling Guide. Release 13 (update 17D)

Oracle. Financials Cloud Implementing Subledger Accounting. Release 13 (update 17D)

An Oracle Technical White Paper September Oracle VM Templates for PeopleSoft

RMH GENERAL CONFIGURATION

Data Import Guide DBA Software Inc.

Exclaimer Signature Manager 2.0 Release Notes

Microsoft Dynamics AX 4.0

Security Explorer 9.1. User Guide

Customize. Building a Customer Portal Using Business Portal. Microsoft Dynamics GP. White Paper

Exclaimer Mail Disclaimers 1.0 Release Notes

What s New in Microsoft Dynamics NAV 2013 R2

Collaborate with Your Care Teams

Exclaimer Mail Disclaimers 1.0 Release Notes

Please distribute to all Spectra users in your company.

Entrust Cloud Enterprise. Enrollment Guide

Genesis Advantage. Version 7

Sage Upgrade Guide. July 2018

Bank Reconciliation Release 2015

Administrator's Guide

NC Tax. Documentation. NCT 8.02 for Microsoft Dynamics NAV 2016*

Sage What s New. October 2017

Oracle. Field Service Cloud Using Android and ios Mobile Applications 18B

Integrate Salesforce. EventTracker v8.x and above

Software Document MCU Driver Porting Guide

Oracle Fusion Middleware Creating Domain Templates Using the Domain Template Builder. 12c ( )

Sage Line 500 Connector Tool V1.0 White Paper

Oracle. Loyalty Cloud Extending Loyalty. Release 13 (update 18B)

Microsoft Dynamics AX. Lifecycle Services: Operate Phase. Last Updated: June 2014 AX 2012 R3 / Version 1.0.0

INNOVATE. Creating a Windows. service that uses Microsoft Dynamics GP econnect to integrate data. Microsoft Dynamics GP. Article

Microsoft Dynamics GP. Analytical Accounting

Sage What's New?

Aldelo Polling Server User Manual

RMH POS USER INTERFACE & NAVIGATION

Spectra March 2019

U.S January Payroll Tax Update

Microsoft Dynamics GP System Administrator s Guide

Product Update: ET82U16-029/ ET81U EventTracker Enterprise

Dell Management Portal. Apple Device Enrollment Program

FAQs OData Services SAP Hybris Cloud for Customer PUBLIC

Transcription:

Microsoft Dynamics AX 2012 Using the refactored formletter framework The formletter framework in Microsoft Dynamics AX is used when posting documents for sales or purchase orders. The framework has been refactored in Microsoft Dynamics AX 2012 to provide better support for customizations, extensibility, and performance. This document describes the changes to the framework and how to update your customizations to take advantage of them. Date: May 2011 http://microsoft.com/dynamics/ax Author: Kenneth Puggaard, Senior Development Lead Send suggestions and comments about this document to adocs@microsoft.com. Please include the white paper title with your feedback.

Table of Contents Introduction... 3 Background... 3 The formletter framework in Microsoft Dynamics AX 2012... 5 The FormLetterServiceController class... 8 The FormLetterContract class... 9 The FormletterService class...10 The FormletterParmData class...11 The FormletterJournalCreate class...12 The FormletterJournalPost class...13 The FormletterJournalPrint class...15 The FormletterProvider class...15 Where to place Microsoft Dynamics AX 2009 customizations...16 Batch parallelism enhancements... 18 The FormletterServiceBatchTaskManager class...20 The FormletterServiceMultithread class...20 Batch task classes...21 2

Introduction The formletter framework in Microsoft Dynamics AX is used when posting documents for sales or purchase orders. This framework has been refactored in Microsoft Dynamics AX 2012 to provide better support for customizations, extensibility, and performance. This document describes the Microsoft Dynamics AX 2012 version of the framework. Background In Microsoft Dynamics AX 2009, the formletter framework consisted of the following objects: The FormLetter base class that extended RunBaseBatch. Module-specific classes that extended the FormLetter class, such as SalesFormLetter. A number of document-specific classes that extended the module class, such as SalesFormLetter_PackingSlip. This set of classes had a number of functions, including the following: Interaction with the posting form, such as SalesEditLines. Creation and maintenance of posting data, such as records in SalesParmTable. Creation of journal data, such as records in CustPackingSlipJour/CustPackingSlipTrans. Validations. Updating subledgers, such as ledger and inventory. Controlling document outputs, such as printing and XML export. Client/server marshaling. 3

Figure 1 shows the formletter framework in Microsoft Dynamics AX 2009. RunBaseBatch FormLetter PurchFormLetter SalesFormLetter ProjFormLetter PurchRFQFormLetter PurchFormLetter_PurchOrder SalesFormLetter_Confirm ProjFormLetter_Invoice PurchRFQFormLetter_Send PurchFormLetter_ReceiptsList SalesFormLetter_PickingList PurchRFQFormLetter_Accept PurchFormLetter_PackingSlip SalesFormLetter_PackingSlip PurchRFQFormLetter_Reject PurchFormLetter_Invoice SalesFormLetter_PackingSlipProject PurchRFQFormLetter_ReSend SalesFormLetter_Invoice SalesFormLetter_InvoiceProject SalesFormLetter_FreeText Figure 1: Class diagram: Formletter framework in Microsoft Dynamics AX 2009 Because the FormLetter classes had so much functionality and no well-defined APIs in Microsoft Dynamics AX 2009, they were complex for developers to understand and customize. 4

The formletter framework in Microsoft Dynamics AX 2012 In Microsoft Dynamics AX 2012, the formletter framework has been refactored to clearly separate the functionality needed for the posting process into different classes. This has led to a number of new class hierarchies. The following class diagram compares the new set of base classes in Microsoft Dynamics AX 2012 to Microsoft Dynamics AX 2009 and shows how the classes interact with each other in Microsoft Dynamics AX 2012. FormLetter base class in Microsoft Dynamics AX 2009 FormLetter base classes in Microsoft Dynamics AX 2012 RunBaseBatch SysOperationServiceController FormLetter FormLetterServiceController +prompt() +run() +main() +prompt() +run() +afteroperation() +main() FormLetterContract FormletterParmData +createdata() +rearrange() +reselect() FormletterService +run() FormletterJournalCreate FormletterJournalPost FormletterJournalPrint -createjournal() +run() -post() +run() #doprint() +printjournal() FormletterProvider Figure 2: Class diagram: Formletter framework base classes 5

The Microsoft Dynamics AX 2009 base FormLetter class has been split into eight base classes. It also has been changed to run under the SysOperation framework. Switching to the SysOperation framework has the advantage of executing the code on the server tier during posting in IL (intermediate language). Because of the switch to using the SysOperation framework, client callbacks from code running on the server tier are no longer supported. Client callbacks result in an exception. Figure 3 shows how the various base classes are used when posting a document for an order. FormletterParmData FormletterService FormletterJournalPost FormLetterServiceController «Form» Posting form FormLetterContract FormletterJournalCreate FormletterJournalPrint main() construct() createdata() run() pack() run() postsalesorderpackingslip() construct() unpack() run() run() printjournal() afteroperation() Figure 3: Sequence diagram: Posting an order document, base class view. 6

Figure 4 shows how the various class hierarchies are used when posting a sales order packing slip document. SalesFormletterParmDataPacking slip FormletterService SalesPackingSlipJournalPost SalesFormLetter_PackingSlip «Form» SalesEditLines SalesFormLetterPackingSlipCont ract SalesPackingSlipJournalCreate SalesPackingSlipJournalPrint main() construct() createdata() run() pack() run() postsalesorderpackingslip() construct() unpack() run() run() printjournal() afteroperation() Figure 4: Sequence diagram: Posting a sales order packing slip document 7

The FormLetterServiceController class The FormLetterServiceController class has replaced the Microsoft Dynamics AX 2009 FormLetter class. The class is the entry point for the formletter framework and can be used to interact with the posting form (for example, the SalesEditLines form). The FormLetterServiceController class is executed on the client tier. The class gathers the information needed during the posting process and passes these values to the FormletterService class using the data contract class pattern. The FormLetterServiceController invokes the FormletterService class when the run method is called. Figure 5 illustrates the FormLetterServiceController class hierarchy. SysOperationServiceController FormLetterServiceController +run() SalesFormLetter PurchFormLetter +prompt() +main() +prompt() +main() SalesFormLetter_Confirm SalesFormLetter_PickingList PurchFormLetter_PurchOrder PurchFormLetter_ReceiptsList SalesFormLetter_PackingSlip SalesFormLetter_Invoice PurchFormLetter_PackingSlip PurchFormLetter_Invoice Figure 5: Class diagram: FormLetterServiceController class hierarchy The module-specific classes from Microsoft Dynamics AX 2009, such as SalesFormLetter, have been changed so that they now extend the FormLetterServiceController class. All functionality that does not relate to the interaction with the posting form has been moved to other class hierarchies. The class variables that were assigned a value to be used during the posting process have been moved to the data contract classes. The pattern used for assigning values to the data contract classes is that the parm methods from Microsoft Dynamics AX 2009 have been changed to utilize the data contract class instead of using a global class variable. The following code sample is an example of a parm method: public boolean parmdirectdeliveryupdate(boolean _directdeliveryupdate = salesformlettercontract.parmdirectdeliveryupdate()) { } return salesformlettercontract.parmdirectdeliveryupdate(_directdeliveryupdate); 8

The FormLetterContract class The FormLetterContract class is the base data contract class in the formletter framework. The data contracts follow the same class hierarchy structure as the FormletterServiceController classes. Therefore, each class in the FormLetterServiceController class hierarchy has a corresponding data contract class. The data contract classes pass data from the FormLetterServiceController to the FormletterService. Figure 6 illustrates the FormLetterContract class hierarchy. FormLetterContract +pack() +unpack() SalesFormLetterContract PurchFormLetterContract SalesFormLetterConfirmContract SalesFormLetterPickingListContract PurchFormLetterPurchOrderContract PurchFormLetterReceiptsListContract SalesFormLetterPackingSlipContract SalesFormLetterInvoiceContract PurchFormLetterPackingSlipContract PurchFormLetterInvoiceContract SalesFormLetterFreeTextContract PurchFormLetterApprovalContract Figure 6: Class diagram: FormLetterContract class hierarchy Parm methods are used to set and get the data from a contract class. The following code sample is an example of a parm method: [DataMemberAttribute] public NoYes parmdirectdeliveryupdate(noyes _directdeliveryupdate = directdeliveryupdate) { } directdeliveryupdate = _directdeliveryupdate; return directdeliveryupdate; 9

The FormletterService class The FormletterService class can be used to control the posting flow for a number of journals. The class is bound to the server tier and executes in IL, which means that there can be no client callbacks from this class. Client callbacks result in an exception. Figure 7 illustrates the FormletterService class hierarchy. FormletterService +run() +postsalesorderconfirmation() +postsalesorderpickinglist() +postsalesorderpackingslip() +postsalesorderinvoice() +postpurchaseorderconfirmation() +postpurchaseorderreceiptlist() +postpurchaseorderpackingslip() +postpurchaseorderinvoice() Figure 7: Class diagram: FormletterService The run method posts documents. The following code roughly shows the pattern used in the run method in the service. If (lateselection)//if the late selection option is used. { } formletterparmdata.createdata() //Create posting data. While (next parmtable) //Loop over posting data, one parmtable record per journal. { } formletterjournalcreate.run(); //Create one journal. formletterjournalpost.run(); //Post one journal. If (printout == Current) //If printing after each posted journal. { } formletterjournalprint.printjournal(); //Print current posted journal. If (printout == After) //If printing all journals after posting. { } formletterjournalprint.printjournal(); //Print all posted journals. The class also has a service operation method for each of the document types that can be posted by this service, such as PostSalesPackingSlip. [SysEntryPointAttribute] FormletterOutputContract postsalesorderpackingslip(salesformletterpackingslipcontract _contract) { formlettercontract = _contract; this.run(); return outputcontract; } 10

The FormletterParmData class The FormletterParmData class hierarchy can be used to create and maintain posting data in the parm tables, such as SalesParmUpdate, SalesParmTable, and SalesParmLine. The base class uses a template pattern, defining a template for how to create records in the parm tables. There are modulespecific classes such as SalesFormletterParmData, and one class for each document type supported, such as SalesFormletterParmDataPackingslip. The class has three public APIs: CreateData, which creates the needed data in the parm tables. ReSelect, which recreates the data based on the specqty in the posting form. ReArrange, which rearranges the data in the tables based on summary update settings. Figure 8 illustrates the FormletterParmData class hierarchy. FormletterParmData +createdata() +rearrange() +reselect() SalesFormletterParmData PurchFormletterParmData SalesFormletterParmDataConfirm SalesFormletterParmDataPickingList PurchFormletterParmDataPurchOrder PurchFormletterParmDataReceiptList SalesFormletterParmDataPackingslip SalesFormletterParmDataInvoice PurchFormletterParmDataPackingSlip PurchFormletterParmDataInvoice PurchFormletterParmDataApproveJournal Figure 8: Class diagram: FormletterParmData class hierarchy 11

The FormletterJournalCreate class The FormletterJournalCreate class hierarchy has the responsibility of creating one journal with a header, for example, CustPackingSlipJour, and a number of lines, for example CustPackingSlipTrans, and related journal data, for example, CustPackingSlipSalesLink. The base class uses a template pattern, defining the template for creating a journal. The template looks roughly like this if (this.check())//validate that the journal can be created. { this.initjournalheader();//initialize the journal header. this.createjournalheader(); //Create the journal header. this.createjournallines(); //Create journal lines. if (this.isjournalcreated()) //If a journal were successfully created. { this.insertrecordlist();//insert all records into the database. this.endcreate();//finalize journal creation. } } 12

The FormletterJournalCreate class hierarchy is illustrated in Figure 9. FormletterJournalCreate +run() -createjournal() FormLetterVersionableJournalCreate SalesConfirmJournalCreate PurchPurchOrderJournalCreate SalesPickingListJournalCreate PurchPackingSlipJournalCreate SalesPackingSlipJournalCreate PurchReceiptsListJournalCreate SalesInvoiceJournalCreate PurchInvoiceJournalCreate FormLetterJournalCreateVersioning PurchApproveJournalCreate FormLetterJournalCreateInitialVersion FormLetterJournalCreateCorrection Figure 9: Class diagram: FormletterJournalCreate class hierarchy There are also document specific classes for each of the documents that can be created by the framework, such as SalesPackingSlipJournalCreate. These classes hold the logic specific for a document. Those document classes that support having multiple versions of the same document extend the FormletterVersionableJournalCreate class. The FormletterService class instantiates this class hierarchy for each of the journals it needs to create and calls run. The FormletterJournalPost class The FormletterJournalPost class hierarchy can be used to post one journal, for example, updating ledger and inventory. The base class uses a template pattern, defining the template for posting a journal. There is also a document specific class for each of the documents that can be posted by the framework, for example SalesPackingSlipJournalPost. These classes hold the logic specific for a document. This class hierarchy requires that a journal has been created and passed in. 13

The FormletterService class instantiates this class for each of the journals it needs to post and calls run. Figure 10 is an illustration of the FormletterJournalPost class hierarchy. FormletterJournalPost +run() -post() SalesConfirmJournalPost SalesPickingListJournalPost PurchPurchOrderJournalPost PurchReceiptsListJournalPost SalesPackingSlipJournalPost SalesInvoiceJournalPost PurchPackingSlipJournalPost PurchInvoiceJournalPost PurchApproveJournalPost Figure 10: Class diagram: FormletterJournalPost class hierarchy 14

The FormletterJournalPrint class The FormletterJournalPrint class hierarchy can be used to control the printing of one or more journal documents. There is a document-specific class for each the documents that can be printed by the framework. The FormletterService class instantiates this class either for each of the journals being posted, or once with a list of all posted journals. Figure 11 is an illustration of the FormletterJournalPrint class hierarchy. FormletterJournalPrint -doprint() +printjournal() SalesConfirmJournalPrint SalesPickingListJournalPrint PurchPurchOrderJournalPrint PurchReceiptListJournalPrint SalesPackingSlipJournalPrint SalesInvoiceJournalPrint PurchPackingSlipJournalPrint PurchInvoiceJournalPrint Figure 11: Class diagram: FormletterJournalPrint class hierarchy The FormletterProvider class The FormletterProvider class can be used to provide module specific data to each of the other class hierarchies. There is one child class per module, for example, SalesFormletterProvider. Figure 12 is an illustration of the FormletterProvider class hierarchy. FormletterProvider FormletterProviderNull SalesFormletterProvider PurchFormletterProvider Figure 12: Class diagram: FormletterProvider class hierarchy 15

Where to place Microsoft Dynamics AX 2009 customizations The following table shows where customizations made to the Microsoft Dynamics AX 2009 formletter framework should be moved in the Microsoft Dynamics AX 2012 formletter framework. Microsoft Dynamics AX 2009 object Customization made to logic for Microsoft Dynamics AX 2012 object Formletter Creating parm data FormletterParmData Creating journal data Posting a journal General posting Printing Interacting with posting form FormletterJournalCreate FormletterJournalPost FormletterService FormletterJournalPrint FormLetterServiceController SalesFormletter Creating parm data SalesFormletterParmData Interacting with SalesEditLines form SalesFormLetter SalesFormletter_Confirm Creating parm data SalesFormletterParmDataConfirm Creating journal data Posting a journal Printing Interacting with SalesEditLines form SalesConfirmJournalCreate SalesConfirmJournalPost SalesConfirmJournalPrint SalesFormLetter_Confirm SalesFormletter_PickingList Creating parm data SalesFormletterParmDataPickingList Creating journal data Posting a journal Printing Interacting with SalesEditLines form SalesPickingListJournalCreate SalesPickingListJournalPost SalesPickingListJournalPrint SalesFormLetter_PickingList SalesFormletter_PackingSlip Creating parm data SalesFormletterParmDataPackingslip Creating journal data Posting a journal Printing Interacting with SalesEditLines form SalesPackingSlipJournalCreate SalesPackingSlipJournalPost SalesPackingSlipJournalPrint SalesFormLetter_PackingSlip SalesFormletter_Invoice Creating parm data SalesFormletterParmDataInvoice Creating journal data Posting a journal Printing Interacting with SalesEditLines form SalesInvoiceJournalCreate SalesInvoiceJournalPost SalesInvoiceJournalPrint SalesFormletter_Invoice PurchFormletter Creating parm data PurchFormletterParmData 16

Microsoft Dynamics AX 2009 object Customization made to logic for Interacting with PurchEditLines form Microsoft Dynamics AX 2012 object PurchFormLetter PurchFormletter_PurchOrder Creating parm data PurchFormletterParmDataPurchOrder Creating journal data Posting a journal Printing Interacting with PurchEditLines form PurchPurchOrderJournalCreate PurchPurchOrderJournalPost PurchPurchOrderJournalPrint PurchFormLetter_PurchOrder PurchFormletter_PickingList Creating parm data PurchFormletterParmDataReceiptsList Creating journal data Posting a journal Printing Interacting with PurchEditLines form PurchReceiptListJournalCreate PurchReceiptListJournalPost PurchReceiptListJournalPrint PurchFormLetter_ReceiptsList PurchFormletter_PackingSlip Creating parm data PurchFormletterParmDataPackingSlip Creating journal data Posting a journal Printing Interacting with PurchEditLines form PurchPackingSlipJournalCreate PurchPackingSlipJournalPost PurchPackingSlipJournalPrint PurchFormLetter_PackingSlip PurchFormletter_Invoice Creating parm data PurchFormletterParmDataInvoice Creating journal data Posting a journal Printing Interacting with PurchEditLines form PurchInvoiceJournalCreate PurchInvoiceJournalPost PurchInvoiceJournalPrint PurchFormLetter_Invoice 17

Batch parallelism enhancements The batch parallelism strategy used by the formletter framework has been enhanced in Microsoft Dynamics AX 2012. The formletter framework can now use batch parallelism both when using late selection to create posting data and when posting the journals. The default batch task size has been change to include five orders or journals per batch task. The batch size is customizable in the parameter forms for sales and purchase orders. When a posting is executed in batch and late selection is chosen, the framework will start a number of create posting data tasks that create data for the orders in the posting data tables (for example, one record per sales order in the SalesParmTable table). It also starts one rearrange posting data task that rearranges the posting data based on the summary update settings when all the create posting data tasks have completed. When the posting data creation is completed, or late selection is not chosen, then the framework starts a number of post journal tasks, each handling a number of journals, and an end posting task that finalizes the posting when all post journal tasks have completed. 18

Figure 13 shows the batch parallelism posting process. Start batch posting Use late selection Yes Schedule posting data tasks No Create posting data Create posting data Create posting data Rearrange posting data Schedule posting tasks Post journals Post journals Post journals End posting Done Figure 13: Batch parallelism 19

The FormletterServiceBatchTaskManager class The FormletterServiceBatchTaskManager class can be used to create batch tasks when the formletter framework is set to execute in batch. Figure 14 illustrates the FormletterServiceBatchTaskManager class hierarchy. FormletterServiceBatchTaskManager +createtasks() FormletterService +run() Figure 14: Class diagram: FormletterServiceBatchTaskManager The FormletterServiceMultithread class The FormletterServiceMultithread class is a specialization of the FormletterService class. The class is invoked from the FormletterServiceBatchTask class and ensures that the service handles only the journals that the tasks have responsibility for. Figure 15 illustrates the FormletterServiceMultithread class hierarchy. FormletterService +run() FormletterServiceMultithread Figure 15: Class diagram: FormletterServiceMultithread 20

Batch task classes The formletter framework contains four batch task classes that extend the base FormletterBatchTask class. The following table describes what each batch task class can be used for. Batch task class FormletterParmDataCreateDataBatchTask FormletterParmDataRearrangeBatchTask FormletterServiceBatchTask FormletterServiceEndBatchTask Use Creating posting data for each order passed to the class. Rearranging the posting data based on the summary update settings. Utilizing the FormletterServiceMultithread class to post the journals passed to the class. Finalizing the posting process. Figure 16 illustrates the FormletterBatchTask class hierarchy. RunBaseBatch FormletterBatchTask +run() FormletterServiceBatchTask FormletterParmDataCreateDataBatchTask FormletterServiceEndBatchTask FormletterParmDataRearrangeBatchTask FormletterServiceBatchTaskManager +createtasks() FormletterServiceMultithread FormletterService +run() Figure 16: Class diagram: Formletter batch tasks 21

Microsoft Dynamics is a line of integrated, adaptable business management solutions that enables you and your people to make business decisions with greater confidence. Microsoft Dynamics works like and with familiar Microsoft software, automating and streamlining financial, customer relationship and supply chain processes in a way that helps you drive business success. U.S. and Canada Toll Free 1-888-477-7989 Worldwide +1-701-281-6500 www.microsoft.com/dynamics This document is provided as-is. Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. Some examples depicted herein are provided for illustration only and are fictitious. No real association or connection is intended or should be inferred. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. You may modify this document for your internal, reference purposes. 2011 Microsoft Corporation. All rights reserved. Microsoft, Microsoft Dynamics, and the Microsoft Dynamics logo are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners. 22