General X++ Development

How do I create a runnable class in D365FO?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I create a runnable class in D365FO?

SSunny Vasty75 reputation · answered Aug 13, 2026

Create a class with a static main() method.

X++
internal final class MyRunnableClass
{
    public static void main(Args _args)
    {
        info('Hello from X++.');
    }
}

Build it, then run the class from Visual Studio using the normal runnable/startup-object workflow for your development environment.

Runnable classes are one of the quickest ways to test a piece of X++ without building a form, menu item, or batch framework around it.