web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Dynamics 365 Tech Blog / Create a runnable class in ...

Create a runnable class in Dynamics 365 for Finance and Operations

feelyd Profile Picture feelyd 260

In this tutorial we are going to create a simple job in Dynamics 365 Finance and Operations. This is one of the simplest pieces of code you can write. It's great for testing other larger pieces of functionality. To kick this off we need to create a project in Visual Studio and add a class to this project.
Lets start by first opening Microsoft Visual Studio. I'm using version 2015 which came with my development environment.

Step 1 image

Once we are in Visual Studio lets create a new project. Lets navigate to the File and New Option. In the sub menu we are going to create a new Project. There are lots of different options  to choose from, we're looking for Unified Operations. 

Step 2 image

We have lots of different templates to choose from. We are going to choose Dynamics 365 in the templates on the right hand side. In the project types which are displayed we have a number of different project types to choose from. For this tutorial we are going to choose the Unified Operations project type. 

Step 3 image

In the Name option, let's give our project a name. I'm going to enter D365Tutorials as my project name. Make sure the Create directory for solution option is selected. 

Step 4 image

5 Ok first steps completed. We have created an empty project. Notice two other details near the project name D365Tutorial (USR) [FeelyConsultants]. USR is the layer the project is created in. FeelyConsultants is the model which the project is part off.

Step 5 image

6 An empty project is not very exciting. Lets add some code to this project. Right click and project name and in the project name Click Add.

Step 6 image

7 Click New Item. If you had other code classes you wanted to import we would use the existing item. In this case the code is new so let's choose the New Item option 

Step 7 image

8 In the window which pops up, click on the Code option. This will narrow down the items we can choose from to Code objects 

Step 8 image

9 Now we have code only options. Choose Runnable Class. Classes are blocks of code that contain data and methods. When developing for Finance and Operations apps, you will use the X++ language to create new classes.
 

Step 9 image

10 Give your class a name  and Click Add. I am going to call this class RunnableClassCust. I'm going to write some customer specific code in this class

Step 10 image

10b Click

Step 10b image

Comments

*This post is locked for comments