/ Dynamics

[X++] SysExtension Attribute name of parm method

If you are using the SysExtensionFramework introduced with Dynamics AX 2012 and creating a new attribute class derived from SysAttribute, you have to name the parm-method(s) of your new attribute class like your parameter in the new-method!
Otherwise you will have a bad time figuring out that the following line checks this in standard:
\Classes\SysExtModelAppClassPropValueMapProvider\addPropertyValue
Line 16 checks if the parm method with name format 'parm' + [nameOfParameter] is present.

Example

classDeclaration
class MyNewAttribute extends SysAttribute
{
    ClassId     locClassId;
}
new

Note the name of the parameter matches the name of the parm method!

public void new(ClassId _locClassId)
{
    super();
    this.parmLocClassId(_locClassId);
}
parm
public ClassId parmLocClassId(ClassId _locClassId = locClassId)
{
    locClassId = _locClassId;

    return locClassId;
}

I hope to save you the 10 minutes of time and the nerves I spent on figuring this out.

[X++] SysExtension Attribute name of parm method
Share this

Subscribe to robsCode