Solving an ‘Object object has not been initialized’ runtime error
If you have received the error below, and are scratching your head over the cause:

Then the answer is to check you have called super() in your constructor. The compilation output will also display a warning to that effect:

Related notes about extending Object and initialization
Unlike C#, Object is not implicitly extended when creating a new class. You’ll need to ensure that the ‘extends object’ class declaration is included if you want to call methods declared in Object, eg:

Repeating the aforementioned error (and also unlike C#) the base constructor is not implicitly called in X++:
void new()
{
;
super(); //base constructor is not called implicitly
}