DictTable.callStatic Method [AX 2012]
Calls the specified static method for a table.
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();
}
Community Additions
ADD
Show: