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à!