One of the tasks that was like headch for me was to enable the created by and modifed by in sepicfic group of tables , which is a very important requirment in every succefull implemetation
so that i invented a solution for these task , the following job will enable any one to track the changes in the data by enable created by/created date time and modified by / modified date time property in each Parameter and Group Table type which will allow you to catch any one trying to mess up the appication
static void EnableTableProperty(Args _args)
{
SysDictTable dictTable,sysDictTable;
TreeNode node;
#AOT Name name;
TreeNode treeNode;
str indexName;
#Properties
;
treeNode = TreeNode::findNode(#TablesPath);
treeNode = treeNode.AOTfirstChild();
while (treeNode)
{
name = treeNode.AOTname();
sysDictTable = SysDictTable::newTableId(treeNode.applObjectId());
if ((sysDictTable.tableGroup() == tableGroup::Parameter ||
sysDictTable.tableGroup() == tableGroup::Group) &&
!sysDictTable.isMap() &&
!sysDictTable.isTmp() &&
!sysDictTable.isView() &&
sysDictTable.enabled())
{
node = SysDictTable.treeNode();
node.AOTsetProperty(#PropertyCreatedBy, #PropertyValueYes);
node.AOTsetProperty(#PropertyCreatedDateTime, #PropertyValueYes);
node.AOTsetProperty(#PropertyModifiedBy, #PropertyValueYes);
node.AOTsetProperty(#PropertyModifiedDateTime, #PropertyValueYes);
node.AOTsave();
node.treeNodeRelease();
node = null;
}
}
}