Tuesday, October 25, 2011

Error : "The server-side impersonated (RunAs) session tried to invoke a method that is available for client-side processing only.

As we all know that in Ax2009 the batch runs on server side so when client is not open it will run on the backend side.But in Ax 4.0 it use to run on client side.Due to side while moving certain code (related to batch process)from Ax4.0 to Ax5.0 we have not modify the way of execution perfectly Due to that this kind of issue raised.
Solution:
1.To move the all batch process run on client side please do modification on \Classes\RunBaseBatch\runsImpersonated() make it false.
2.To move our reported batch process then over write the above method in our class.
3.At the runtime you can change the batch execution location by the backend
UPDATE dbo.BATCH SET RUNTYPE = 0 WHERE CAPTION = '[Your job caption name]'