Friday, March 9, 2012

Object does not have method error in AIF - Dynamics Ax 2012

There is sometime an error prompts during processing outbound files which says - Error executing code: AxXXX class object does not have parmXXX(). This parmXXX() method may be a new calculated/unbounded method or a bounded method in AxXXXX class objects which extends AxInternalBase.






























There are few things need to be performed to take this error out. It is basically a compilation problem where the method object can not be found at runtime.
First, use compile and  compile forward for all the objects pertaining to a AIF document service.
Secondly, compile forward the base class - AxInternalBase
At last, select the project node and "Generate incremental CIL".

































The outbound messages can be processed now with not this type of error.

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. After having this problem for months and nothing posted on the Internet fixed the problem I was determined to find the root of the problem.

    If your parmXXX method does not have a default value in the definition then the method will process fine on a client, but when it is run through a batch job it will fail with the error: 'Error executing code: AxXXX object does not have method 'parmXXX'.

    Solution: Add the default value to the method definition
    public [return type] parmXXX( _[variable name] = [default value])
    In my case the type was a string so the [default value] becomes ''

    Hope this helps others fighting this problem.

    ReplyDelete
    Replies
    1. Should read: (sorry it stripped out the block defined by my brackets so I had to use a different char)

      Solution: Add the default value to the method definition
      public [return type] parmXXX([return type] _[variable name] = [default value])

      Delete