title: Dynamics AX Call Non-Static Method Dynamically
body: <p>I want to make a class that has the ability to dynamically call methods in other classes by name.  Ideally, it would accept the class and method names as well as a collection of parameters.  dictClass works well for this on static methods, but doesn't seem to work on instance methods.</p>
  
  <p>Is there any way to make the following code work for non-static methods?</p>
  
  <pre><code>[SysEntryPointAttribute]
  public str methodExecute(str className, str methodName, str params)
  {      
  DictClass           dictClass; 
  anytype             retVal; 
  str                 connMessage;
  ExecutePermission   perm; 
  
  perm = new ExecutePermission(); 
  
  // Grants permission to execute the DictClass.callStatic method. 
  // DictClass.callStatic runs under code access security. 
  perm.assert(); 
  
  dictClass = new DictClass(className2Id(className)); 
  
  if (dictClass != null) 
  {        
      retVal = dictClass.callStatic(methodName); 
      connMessage = strfmt("Return value is %1", retVal); 
  } 
  
  // Closes the code access permission scope. 
  CodeAccessPermission::revertAssert(); 
  
  return connMessage;
  }
  </code></pre>