The Problem:
- I have a list with Objects as elements.
- I use enumerator to loop over the list.
- While looping I assign elements to a variable object with the same type as the element.
- When I call a method on the object, but I get the following error-message:
MyClass object not initialized.
I think I must cast, but don't know how to do this in Dynamics AX.
I develop in MS Dynamics AX 2012.
MyExampleDataContract exampleDataContract = new MyExampleDataContract();
while (listEnumerator.moveNext())
{
exampleDataContract = listEnumerator.current();
info(exampleDataContract.parmCustomerId()); //This gives an error.
}