Using x++ code running some of Common object.
remark by Jimmy Dec. 21th 2010
void clicked()
{
UtilIdElements _UtilIdElements;
MenuFunction MF;
treeNode treeNode;
xInfo xInfo = new xInfo();
sysTableBrowser sysTableBrowser;
#AOT
;
// winAPI::shellExecute(UtilIdElements.name);
// select firstonly _UtilIdElements
// where _UtilIdElements.name == UtilIdElements.name
// && _UtilIdElements.recordType == UtilElementType::Menu;
// if(_UtilIdElements)
switch(UtilIdElements.recordType)
{
case UtilElementType::DisplayTool :
smmUtility::openMenuItemForm(UtilIdElements.name,UtilIdElements,null,false);
break;
case UtilElementType::ActionTool :
MF = New MenuFunction(UtilIdElements.name,MenuItemType::Action);
MF.run();
break;
case UtilElementType::OutputTool :
MF = New MenuFunction(UtilIdElements.name,MenuItemType::Output);
MF.run();
break;
case UtilElementType::Job :
if(!Box::yesNo('Are you sure running this Job? may be affect some data.please know!',DialogButton::No,'Running job'))
return ;
treeNode = xInfo.rootNode();
treeNode = treeNode::findNode("Jobs").AOTfindChild(UtilIdElements.name);
treeNode.AOTrun();
break;
case UtilElementType::Table :
/*
treeNode = treeNode::findNode(#tablespath);
treeNode = treeNode.AOTfindChild(UtilIdElements.name);
treeNode.AOTrun();
*/
sysTableBrowser = new sysTableBrowser();
sysTableBrowser.setAllowEdit(true);
SysTableBrowser.setAllowDelete(true);
sysTableBrowser.Run(tableName2Id(UtilIdElements.name));
break;
case UtilElementType::Form :
treeNode = treeNode::findNode(#FormsPath);
treeNode = treeNode.AOTfindChild(UtilIdElements.name);
treeNode.AOTrun();
break;
default :
break;
}
}