Change "Main Menu's" Caption

Does anyone know how to change “Main Menu’s” caption, not from properties window, but from code. For example if we want to display user name at Main Menu’s caption. we can’t modify it from properties window can we?

Well, you can try this: Call your method in Application\startup() And in this method find the Menus treeNode using the TreeNode class. and then find the MainMenu subNode. And change the property Caption to the one you need using curUserId()

Here is a job that does what you need. static void Job13(Args _args) { // Menu menu = new Menu(‘MainMenu’); TreeNode treeNode; str string; int LabelPos, labelPos2, labelEnd; str LabelValue; ; // menu.label(’@SYS71148’); // menu.AOTsave(); // infoLog.rootNode().AOTsave(); // couldn’t get it working - it neads a reboot to set the value in the AOT // but if you open the MainMenu, the value is set treeNode = infoLog.rootNode(); treeNode = treeNode.AOTfindChild(‘Menus’); treeNode = treeNode.AOTfindChild(‘MainMenu’); string = treeNode.AOTgetProperties(); labelPos = strScan(string, ‘label’, 1, strlen(string)); labelPos2 = strScan(string, ‘#’, labelPos, strLen(string)) + 1; labelEnd = strScan(string, ‘\n’, labelPos2, strLen(string)); LabelValue = subStr(string, labelPos2, labelEnd - labelPos2); string = strdel(string, labelPos2, labelEnd - labelPos2); string = strIns(string, ‘@SYS71148’, labelPos2); treeNode.AOTsetProperties(string); treeNode.AOTsave(); infoLog.rootNode().AOTsave(); } The first way is much better and more reliable, but I didn’t get it working at once. But you can play around with it.