Pages

Friday, August 12, 2016

Don't change the name of a Form instance in AX 7

In AX 2012 you could do something like this, where you change the name of a Form instance:

form = new Form(formstr(MyPrettyForm));
form.name("AnotherNameToConfuseEverybody);

args = new Args();
args.object(form);

formRun = classfactory.formRunClass(args);
etc...

In AX 7 changing the name seems to confuse AX to a sense where it can't figure out to actually run eventual code in (at least) the init and run methods of the form.

For many reasons I think it is a poor idea to change the name of a form instance, now there is also a technical reason not do it.

Wednesday, August 10, 2016

Public members vs. Parm methods on classes extending SysAttribute in AX 7

I thought I did the right thing when I changed attribute classes that I moved into AX 7 from AX 2012, so they had public members instead of Parm methods.

Well, don't do that. As it turns out the attribute framework is looking for the Parm methods when trying to apply the member values. If you don't have them, the values are not being set.

Hopefully this information can save you an hour or so of tedious debugging.