DictTable.callStatic Method

Calls the specified static method for a table.

Syntax

public anytype callStatic(str methodName,  )

Run On

Called

Parameters

  • methodName
    Type: str
    The name of the static method to call.
  • Type: [T:]

Return Value

Type: anytype
The results of the call to the methodName parameter.

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.

Examples

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(); 
}

See Also

DictTable Class

DictTable.callObject Method