Create Runnable Class (Job) in Dynamics365 FO

To test a feature or job, a runnable class must be created in Dynamics 365 Finance and Operation.

How to create

Inside Visual Studio, in the Solution Area, do right click on Project and then Add>New Item. Select Dynamics 365 Items – Code and then select Runnable Class from the list. Enter a name and then ok.
A new class will be created in which you will need to insert the code.

How to run

There are many ways to start a Runnable Class.
The first way is to set up you project as startup object and runnable class as startup object and run it from Visual Studio.
The second way is running from browser. Personally I prefer this mode because it is faster and is also convenient for debugging.
To start a Runnable Class it is necessary to enter a URL of this type in the browser:

https://URL/?cmp=CMP&mi=SysClassRunner&cls=CLASSNAME
Parameters:
CMP = Company name
CLASSNAME = Runnable class name

Best Practice

By convention, these Runnable Class typically do not have related menu items and security objects. And therefore can only be run by a user with the system administrator role.

Lascia un commento