SqlDataDictionaryPermission.new Method [AX 2012]
Creates a new instance of the SQLDataDictionaryPermission class.
public void new(IdentifierName methodName)
Run On
CalledParameters
- methodName
- Type: IdentifierName Extended Data Type
The string that represents the name of the method to be called.
The following code example deletes the data in the xRefNames table.
server static void main(Args _args)
{
DictTable dictTable = new DictTable(tablenum(xRefNames));
str sqlTableName;
SqlDataDictionary sqlTable;
if (dictTable && dictTable.enabled())
{
sqlTableName = dictTable.name(DbBackend::Sql);
sqlTable = new SqlDataDictionary();
// Only try to truncate if the table does exist
// in the SQL database
if (sqlTable.tableExist(sqlTableName))
{
new SqlDataDictionaryPermission(
methodstr(SqlDataDictionary, tableTruncate)).assert();
sqlTable.tableTruncate(tablenum(xRefNames));
CodeAccessPermission::revertAssert();
}
}
}
Community Additions
ADD
Show: