Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Calls the specified object method for a table.
Syntax
public anytype callObject(
str methodName,
Common Called,
)
Run On
Called
Parameters
- methodName
Type: str
The name of the object method to call.
- Called
Type: Common Table
The object to call. This parameter could be created by a call to the makeRecord method.
- Type: [T:]
Return Value
Type: anytype
The results of the call to the methodName parameter.
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.
Examples
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();
}