Friday, April 22, 2011

X++ attributes

AX 2012 supports attributes for classes and methods. There are quite a lot of attributes provided out of the box, mostly in AIF, Services, Upgrade, SysTest areas and it is also possible to create new attributes by inheriting from the SysAttribute class.
Attributes can really simplify many frameworks. For example, in the upgrade framework initPreSyncJobs() and initPostSyncJobs() methods, that contained usually quite a large amount of upgrade jobs and dependencies registration code, were effectively deprecated. All the registration is performed now via attributes that are attached to upgrade methods.

9 comments:

  1. I know this if off topic but I'm looking into starting my own blog and was wondering what all is required to get setup? I'm assuming having a
    blog like yours would cost a pretty penny? I'm not very web savvy so I'm not 100% positive.
    Any recommendations or advice would be greatly appreciated.
    Thank you

    Here is my homepage :: filing bankruptcy in florida

    ReplyDelete
  2. Im on dynamics AX 2012. I was working on exposing some functions to a web service. The methods/functions can be added as operations on a service node, but once the return data type is a complex data type, then they cannot be added to list of operations.
    Which attribute should I add to the functions/methods which are of complex return data type?

    //Example 1 (Registers OK on list of operations)
    [SysEntryPointAttribute(true)]
    public int Test1()
    {
    int i=1;
    return i;
    }

    //Example 2 (Does NOT register on list of operations)
    [SysEntryPointAttribute(true)]
    public container Test2()
    {
    container c=["here",1];
    return c;
    }

    ReplyDelete
  3. hello! I found your tutorial very useful, thank you for sharing this :)
    I've just started discovering Microsoft Dynamics CRM, but previously I was working with microsoft dynamics ax solution.

    ReplyDelete