Search code examples
axaptax++dynamics-ax-2012

Object Not Initialized


Creating a server-side X++ class.

Everything works fine when the class is set to run on "Called From" or "Client", but if I change it to "Server" (which is what our client wants) I receive an error message that objects are not initialized.

In this case, "ListIterator is not intialized"

public static void myMethod(list _keyValuePairs)
{
    ListIterator keyValueIterator;

    keyValueIterator = new ListIterator (_keyValuePairs);
    while (keyValueIterator.more())
    {
        //do things here
        keyValueIterator.next();
    }
}

Any suggestions?


Solution

  • In my experience this problem usually occurs if the pack/unpack pattern that is used to transfer class attributes from one tier to the other was not implemented for the class. Your comments indicate the same (initialization on client, execution on server).