There may be other reasons for this error message. But in my case, it turned the wrong join between tables. Initially I though this may has to do something with COC but I wasn’t using any COC, in my case. Debugging showed failure on a line where I used self-join that was totally non-sensible to use. Fixing the where clause after join statement, fixed the issue.
Here was full error message shown in debugger.
Microsoft.Dynamics.Ax.Xpp.InfoException was unhandled by user code
Message: An exception of type 'Microsoft.Dynamics.Ax.Xpp.InfoException' occurred in aoskernel.dll but was not handled in user code
Additional information: Error executing code: Performing NEXT operation on joined cursor is not allowed.
*This post is locked for comments