Monsieur Winner

MS D365FO || Monsieur D365FO

Technical

A runnable class (JOB) using X++

Often time while developing a feature in Visual studio, the programmer would want to test a small piece of code or even write a logic to insert, delete or update data across one or more tables. Notwithstanding, the Runnable class(Job) can be used for many purposes.

 

What is a Runnable class (Job) ?

A Runnable class is simply a class that comes with a main method predefined. To create a Runnable class, add new item in visual studio and select Runnable class(Job).

 

 

class KWSRunnableClass
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
//We are just greeting the world at large
info("Bonjour Monde");
}

}

After compiling, set Runnable class (Job) as startup object and run the project et voilà!

 

 

admin

Komi Siabi is a Bilingual D365FO Solution architect who loves sharing his knowledge as he works on Both Francophone and Anglophone projects around the globe. He enjoys doing some tiktok videos in his leisure time.

Leave a Reply

Your email address will not be published. Required fields are marked *