DictTable.callObject Method [AX 2012]
Calls the specified object method for a table.
public anytype callObject(
str methodName,
Common Called,
)
Run On
CalledParameters
- 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:]
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();
}
Community Additions
ADD
Show: