120 likes | 133 Vues
Learn about the features and steps to create and call Business Operation Framework services in Microsoft Dynamics AX. Includes customizing the UI, attribute-based and code-based customizations, and calling services synchronously or asynchronously.
E N D
Business operation Framework Presented by Syed Baber Development Lead Mazik Global
Features of BOF The Business Operation Framework service is one of the system services exposed by Microsoft Dynamics AX and that adheres to the Windows Communication Foundation (WCF) protocols and standards. Following are the features of BOF: • Allows menu-driven execution or batch execution of services. • Calls services in synchronous or asynchronous mode. • Automatically creates a customizable UI based on the data contract. • Encapsulates code to operate on the appropriate tier (prompting on the client tier, and business logic on the server tier).
How to create a BOF Service • To create a Business Operation Framework service, the following steps must be performed: • Create a data contract class • Identify the parameters passed to the service • Register the class as a Business Operation Framework service • Optionally customize the automatically generated UI for the class
Customizing the UI • Attribute based customizations. Attributes are SysOperationGroupAttribute, SysOperationGroupMemberAttribute, SysOperationDisplayOrderAttribute, SysOperationLabelAttribute etc. • Code based customizations. Using UIBuilder class. For example check CustRecurrenceInvoiceUIBuilder Class.
Validation on Contract Clas • To perform validation on contract class, you need to implement SysOperationValidatable Interface and override the validate method. • For example of this, check CustRecurrenceInvoiceDataContract class.
Modify the service contract at runtime • To modify the contract at runtime, we need to create a controller class extend from SysOperationServiceController class. • Get the contract object by calling the method getDataContractObject from controller class instance and then call the corresponding parm methods of contract class, passing the desired values.
How to call a BOF service A Business Operation Framework service can be called in four ways: • As a menu item. • As a batch process. • Synchronously. • Asynchronously.
To call a Business Operation Framework service from a menu item • Create an Action Menu Item • Set the ObjectType to Class • Set the Object to SysOperationServiceController • Set the Parameters to <ServiceClassName>.<MethodName> • Demo Project.
To call a Business Operation Framework service as a batch operation • Create a job and create the service method in that job. • Demo Project.
To call a Business Operation Framework service synchronously • To run the service synchronously, edit the menu item: • Set the EnumTypeParameter to SysOperationExecutionMode • Set the EnumParameter to Synchronous.
To call a Business Operation Framework service asynchronously • To run the service asynchronously, edit the menu item: • Set the EnumTypeParameter to SysOperationExecutionMode • Set the EnumParameter to Asynchronous