Just a quick note on using RunAs in AX2012: The static method being called by RunAs should have a container parameter in the method declaration. Otherwise, system will complain that the static method was not found. So:
In fact, the same can be said to Global::RunClassMethodIL. However, the error throw by Global::RunClassMethodIL is more helpful. It'll complain that the parameter passed into the static method is incorrect. Seeing that a third parameter of type container is mandatory for Global::RunClassMethodIL, it's easier to get the idea to try adding the container parameter in the target static method. =]
// This would fail with static method not found error.
public
static
void
methodWithoutParm()
{
}
// This would work!
public
static
void
methodWithContainerParm(container _c)
{
}
This posting is provided "Iace Technologies & Services" .
No comments:
Post a Comment