Code highlighting

Wednesday, December 20, 2006

AxCreateNewProject tool Version 1.2

I made some additions and modifications to the AxCreateNewProject tool.
The link to the orignal post about the tool:
AxCreateNewProject Version 1.1.

Modifications are descriped on the homepage:
AxCreateNewProject HomePage

Friday, December 08, 2006

A little modification / add-on to Sidax:

I use one of the features of Sidax most of all - it's the recent projects tab. (we have a lot of projects and I have to work with a lot of them at the same time). So performance of this tab is most critical to me.

And what was wrong is that from time to time I would stumble onto project names that didn't exist anymore, but still were up high in the list of recent projects.
So what this modification does is just verify that the project exists before showing it in the list of recent projects.
(this verification is performed only when the recent projects tab is opened, so it won't cause any performance issues)

To add this modification into your sidax installation, you have to do the following:
1. Add a method to Forms\Sidax:
void updateMruProjects()
int i;
TreeNode privateProjectTreeNode;
TreeNode sharedProjectTreeNode;
TreeNodeName projectName;

boolean existsProject(TreeNodeName _projectName)
TreeNode project;
project = privateProjectTreeNode.AOTfindChild(_projectName);
if (project)
return true;
project = sharedProjectTreeNode.AOTfindChild(_projectName);
if (project)
return true;
return false;
privateProjectTreeNode = SysTreeNode::getPrivateProject();
sharedProjectTreeNode = SysTreeNode::getSharedProject();

for(i = 1; i <= conLen(MruProjects); i++)
projectName = conPeek(mruProjects, i);
if (!existsProject(projectName))
if (element.openedProjects().exists(projectName))
MRUProjects = conDel(MRUProjects, conFind(MRUProjects, projectName), 1);

2. Modify an existing method Forms\Sidax\toglleBut, adding 2 lines at the end:
    if ( == && !collapsed)

That's it. Now the next time you open the recent projects tab, the unexistent project won't be shown. Enjoy!

Tuesday, December 05, 2006

Adding Menu References

Many developers often find it very confusing when trying to add a menu reference into an existing menu.
The reference just doesn't want to be added. :)
And what confuses even more is that some of the menus are added normally, while others are not!

Let's look at an example:
"After creating of a new menu - menu1, I want to add 2 existing menus into it as references: Cust and Vend.
I right-click the menu1 node and select add->menu reference. Drag over the Cust menu (and everything goes fine), and then I try to drag over the Vend menu - and it DOESN'T work! I am lost. what can be the reason for this?"

The explanation is simple:
The menus that were expanded since the time you launched the client, can't be added as references.
You can experiment with this: Try opening the AX client and dragging over a menu as a menu reference. You can see that it works. Now, expand the menu in the AOT and try adding it as a menu reference again. You can see that it is impossible to add it any more. So, to avoid having problems when adding a menu as a reference, you should re-enter the Axapta client and, before expanding the menu, add the needed menu as a reference.

Original article: