Posts

Showing posts from June, 2023

D365FO - How to create a periodic task

Image
This article explains how to create a periodic task or batch job within Dynamics 365 for Finance and Operations using  SysOperationServiceController As part of this example, I will be creating a simple periodic task that requires parameter input from user. To achieve this we need to create the following elements Data contract class UI Builder class (only recommend if you need custom UI fields) Service class Controller class Action menu item Data contract This class is required for handling user data. All parameters defined in this class will be rendered as parameters within the batch job dialog in UI.  Class declaration DataContract Attribute Required to mark this class as a data contract class. SysOperationContractProcessing Attribute Specify the UI builder class within the SysOperationContractProcessing attribute to register the UI builder with the data contract (This is only required if you have a UI builder class. This step is optional and can be skipped) Parameters D...

D365FO - Create a multi-select lookup in batch jobs

Image
D365FO - Create a multi-select lookup in batch jobs In this article, I will be describing how we can create a multi-select lookup for display within the batch job dialog. Contract class Create a new variable of type 'List'. This will store the selected values of the user for the dropdown from the dialog. Create a parm method to access the new list object Ensure to specify the DataMember attribute Add an appropriate label Specify the data type for the list's content Ensure to specify the DataContract and SysOperationContactProcessing attributes above the class declaration. An UI builder is also required. The requirements for this is explained in the next section. Example: UI builder class Create an UI builder class that extends SrsReportDataContractUIBuilder Add a new variable of type 'DialogField'. This will be displayed on the UI for user. Implement the postBuild method. Initialize the contract from this.dataContractObject() and bind the dialog field variable to th...