Partilhar via


DictTable.Callobject(String, Common, Object[]) Method

Definition

Calls the specified object method for a table.

public:
 virtual System::Object ^ Callobject(System::String ^ _methodName, Microsoft::Dynamics::Ax::Xpp::Common ^ _Called, cli::array <System::Object ^> ^ varArgs);
[Microsoft.Dynamics.Ax.Xpp.VarArgs]
public virtual object Callobject (string _methodName, Microsoft.Dynamics.Ax.Xpp.Common _Called, object[] varArgs);
[<Microsoft.Dynamics.Ax.Xpp.VarArgs>]
abstract member Callobject : string * Microsoft.Dynamics.Ax.Xpp.Common * obj[] -> obj
override this.Callobject : string * Microsoft.Dynamics.Ax.Xpp.Common * obj[] -> obj
Public Overridable Function Callobject (_methodName As String, _Called As Common, varArgs As Object()) As Object

Parameters

_methodName
String
_Called
Common
varArgs
Object[]

Returns

The results of the call to the methodName parameter.

Attributes

Remarks

If an attacker can control 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 ExecutePermission class. Make sure that the user has development privileges by setting the security key to SysDevelopment on the control that calls this method.

This example calls the SysUserLog.onlineTime static method in the SysUserLog table and then prints the value that is returned from the call.

{ 
    Dicttable         dictTable; 
    int               onlineTime; 
    Common            common; 
    str               resultOutput; 
    ExecutePermission perm; 
    perm = new ExecutePermission(); 
    dictTable= new DictTable(tablenum(SysUserLog)); 
    if (dictTable != null) 
    { 
        common = dictTable.makeRecord(); 
        // Grants permission to execute the 
        // DictTable.callObject method. DictTable.callObject runs 
        // under code access security. 
        perm.assert(); 
        onlineTime   = dictTable.callObject("onlineTime", common); 
        resultOutput = strfmt("User online time is %1", onlineTime); 
        print resultOutput; 
        pause; 
    } 
    // Close the code access permission scope. 
    CodeAccessPermission::revertAssert(); 
}

Applies to