DictClass.callObject Method

Calls a method on an object.


public anytype callObject(
    str methodName, 
    Object Called, 

Run On



  • methodName
    Type: str
    A string data type that indicates the name of the method to call.
  • Called
    Type: Object Class
    An instance of the object class.
  • Type: [T:]

Return Value

Type: anytype
An anytype data type value that is returned by the specified method.


You must create an instance of the DictClass object by using a class that contains the method that you pass to the callObject method. If an attacker can control the input to the callObject method, a security risk exists. Therefore, this method runs under code access security. Calls to this method on the server require permission from the InteropPermission class. Make sure that the user has development rights by setting the security key to SysDevelopment on the control that calls this method.


This example calls the toString instance method in the Info class, for which the global instance of this class is named infolog, and then prints the value that is returned from the call.

static void Job_Example_DictClass_CallObject(Args _args) 
    DictClass dictClass; 
    anytype   retVal; 
    str      resultOutput; 
    ExecutePermission perm; 
    perm = new ExecutePermission(); 
    // Grants permission to execute the DictClass.callObject method. 
    // DictClass.callObject runs under code access security. 
    dictClass = new DictClass(classidget(infolog)); 
    if (dictClass != null) 
        retVal       = dictClass.callObject("toString", infolog); 
        resultOutput = strfmt("Return value is %1", retVal); 
        print resultOutput; 
    // Closes the code access permission scope. 

See Also

DictClass Class