Code highlighting

Thursday, February 08, 2007

AxCreateNewProject version 1.3.1 available

I have also upgraded the tool for creating new projects to version 1.3.1

The new feature are:
Version 1.3.1
Fixed a small bug I stumbled upon recently: If you temporarily turn off the project prefix that contains a long name, and enter a long name for the project, the validation fails telling that the project name is too long - the CheckBox value is not analyzed.

Version 1.3
Now you can update an existing project adding new project nodes to it. Just select the project you want to update and hold the Ctrl key when calling the AxCreateNewProject tool. This will automatically initialize the Settings Tree with the project group nodes found in the selected project. Also, the warning confirmation message won't be shown when you press the OK button and the existence of a project with the same name is not considered an error in the image window.

Moreover, you can now selectively duplicate the objects of an existing project together with the project group nodes. In order to do this select an existing project for update and simply input a new name for the project. You will notice that a button Copy Objects will appear in the bottom left corner of the dialog window. Pressing this button will add the objects found in the selected project into the Settings Tree and will be copied into the new project as well. You will be able to deselect some of the objects (see Known Issues) if you do not need to carry them over to the new project.

You can download the new version HERE or from the Homepage
AxGoToDeclaration


I haven't posted in a while. Work, work...

Well, meanwhile, I made some new handy tool for Axapta developers.

Purpose
Finds the declaration of the selected variable and opens the editor on the line with the declaration

Functional capabilities
Searches the current method first. If the declaration is not found, goes to the root of the object and looks in the classDeclaration method. If still not found, continues on with the parent of the class.

Implementation
In order to use the tool simply import the project
HERE
and post the following code as a new method of the EditorScripts class:

void AOT_goToDeclaration(Editor e)
{
AxGoToDeclaration goToDeclEngine;
;
goToDeclEngine = new AxGoToDeclaration(e);
goToDeclEngine.goToDeclaration();
}




Known Issues:
  • ParserClass does not parse the constructor (new) method. So variable declarations cannot be found from this method.
  • Does not find variables this, element, etc.
  • Does not find objects with AutoDeclaration set to Yes on forms, nor the datasources

What is planned for upgrade:
  1. Open AOT objects when this or element is selected (table, class, form, etc)
  2. Open AOT objects with the property sheet for objects with AutoDeclaration = Yes
  3. Include global classes into the search

Credits

Thanks to

  • AndyD - for the timer AOT edit code and the selectedLine method modifications
  • MaxBelugin - for ParserClass description

Feedback

If you have any comments or suggestions, please feel free to contact me.

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))
element.openedProjects().remove(projectName);
MRUProjects = conDel(MRUProjects, conFind(MRUProjects, projectName), 1);
}
}
this.updateHistory();
}


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


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:
http://erpkb.com/Axapta/OshibkaSozdanijaSsylkiNaMenju