Partilhar via


DictTable.Callstatic(String, Object[]) Method

Definition

Calls the specified static method for a table.

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

Parameters

_methodName
String
varArgs
Object[]

Returns

The results of the call to the methodName parameter.

Attributes

Remarks

If an attacker can control input to this function, a security risk exists. Therefore, the callStatic 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 SysUserInfo:find static method in the SysUserInfo table and then prints the value that is returned from the call to the callStatic method.

 { 
    Dicttable   dictTable; 
    SysUserInfo userInfo; 
    str         resultOutput; 
    ExecutePermission perm; 
    perm = new ExecutePermission(); 
    // Grants permission to execute the DictTable.callStatic method. 
    // DictTable.callStatic runs under code access security. 
    perm.assert(); 
    dictTable= new DictTable(tablenum(SysUserInfo)); 
    if (dictTable != null) 
    { 
        userInfo     = dictTable.callStatic("find"); 
        resultOutput = strfmt("Current user ID is %1", userInfo.Id); 
        print resultOutput; 
        pause; 
    } 
    // Close the code access permission scope. 
    CodeAccessPermission::revertAssert(); 
}

Applies to