10/28/2016

Observations in sysoperation framework Synchronous execution mode

Observations in Synchronous execution mode.

Called from: Client
Run on: Server (If the service class is registered in AXClient service group, it will run on client, cause the executeOperationWithRunAs returns false in that case.)
Session: CIL (If the service class is registered in AXClient service group, it will run in an interpreter session, cause the executeOperationWithRunAs returns false in that case.)

Possible errors:
  • As I said above, normally synchronous service will be executed on server and in CIL session, but if it's executed on client and interpreter session, we cannot set 'Runon' of the service class to server any longer. Otherwise, we'll see a data contract error like this,
  • If the method is published as an AIF service entry (with [SysEntrypointAttribute]), and the 'Runon' is 'Call from', we'll see this 'uncheced' error when executing,

Conclusion,
In AX, we cannot call a method in a servie class in both synch and asynch mode, because of the 2 errors above and asynch mode needs the service to be registered in AXClient service group.