How to call a class with name string

Hi All,

I need to call classes extended from a base class with their name.

mybaseclass myclass;

str myStr = “myextendedclass”;

myclass = new (I need to call mystr class there)

how can I do this?

The easiest way is classFactory.createClass(className2Id(‘MyClass’)), if you don’t need any parameters passed to the constructor. If you need some, use SysDictClass.makeObject().

You might be also interested in the extension framework (AX 2012 only).

thank you… :slight_smile: