Microsoft Dynamics Ax developer's blog

Monday, December 04, 2006

Go component

Just uploaded a new extension go component - this is like "go" tab from Sidax but standalone and integrated with editor via script.


I am using autohotkey macros to setup hotkeys for various actions and define Ctrl+Enter to go to selected component in the editor:

#IfWinActive, ahk_class AxaptaClientClassName
~^Enter::
SendInput,{APPSKEY}sg
Exit


So you can, for example, edit the class declaration, click on the class name of the class the current class entends and press Ctrl+Enter - you see the parent of the currently editing class.

Monday, November 27, 2006

Tabax 0.2.11

The main new feature is the new button "Edit current field". Open, say, ledger accounts form from main menu, select "Tax group" field and click this button.

You will see AOT for StringEdit:Tax_TaxGroup.

I think this button fill be helpful for developers and consultants to explore axapta functionality.

more...

Wednesday, November 22, 2006

Bunch of Tabax extensions

There are some Tabax extensions occured last week.


  • AxCreateNewProject from Ivan Kashperuk to create an empty project with two clicks

  • Toggle SQL trace for switch SQL trace On/Off instantly with tabax toolbar button (it can be used an example of reflecting state of something via button image )

  • Just a button to run the find dialog for AOT node quickly

Sunday, November 19, 2006

AxPath is coming: Sidax 0.4 beta 0 + Tabax 0.2.10

download tabax | download sidax

There is the first AxPath implementation. AxPath let you store a link for some record in database or an AOT item in the form of URI and then send it to a collegue or open it. So, for example you can copy link to the some purchase order, send it to colleague and it will be opened by colleague (so purchase orders form is opened and positioned at specific order).

Now Tabax, and Sidax support this technique. I am planning integration of AxPath scheme in the system letting AxPath links to be embedded in the webpages, mails, etc.

so, in Sidax:

  • you can copy AxPath of the menu item in main menu with right click
  • you can navigate AxPath via "go component"

in Tabax:
  • AxPath:
    • when pressing the "Copy" button it copies axpath of the current record to the clipboard
    • when pressing the «Ctrl+Shift+Copy» it copies AOT items, currently selected
    • if you insert axpath to the input box it navigates the path given

  • now tabs are switched correctly under AX3KR3
  • X++ calculator in the input box:
    • enter ?<X++ expression> and press Enter to evaluate an expression
    • enter ?<X++ statement> and press Enter to run a statement



I am going to implement "favorits" in the sidax based on AxPath

Wednesday, November 15, 2006

aggreg8.net - trying to aggregate all Dynamics Ax development blogs

Microsoft launched the new site for IT pros - aggreg8. I have'nt realized what it is exactly, but created the workgroup for Dynamics Ax and aggreated some development blogs there: view online

Monday, November 13, 2006

Sidax 0.3.7b14


download



changes:


  • Autohide option at about tab - sidax will autocollapse when you move mouse out of it's window (thank to Blokva from AxForum)

  • Images in the main menu - different menues


Thursday, November 09, 2006

Sidax 0.3.7 beta 12

Axapta hangs when trying to exit from the thin client. Added workaround for this bug. Axapta will still hang if you login and then immediately close it, but I think this is a very rare case.

download

AxUnit2 updated

Some errors fixed, Tabax integration.

See AxUnit2 homepage

Monday, November 06, 2006

Sidax 0.3.7 beta 11

download (35k)

  • It can handle a project renaming correctly now

  • Pause button at 'about' tab: you can stop the background processes so sidax doesn't affect profiler



PS: Axaptapedia is online again

Thursday, November 02, 2006

Tabax 0.2.8

download 20K

What's new:

  • Extensibility !!!: Now you can add plugins to Tabax: just create a subfolder \Share\Include\tabax\plugs and place bitmap with the following name _.bmp, where type of menu item, ItemName - name of an existing menu item and tabax will have an additional button with placed image pointing to your menu item (download table structure browser plugin for example)

  • AxSearch: Tabax now have a new input box for invoke AxSearch from it

osalt - the site colleting open source alternatives to various soft

for example, http://www.osalt.com/photoshop - list of open source alternatives to to Adobe Photoshop

Friday, October 27, 2006

Axaptapedia is down II

Just contacted Andrew Jones via email:


Hi Max

Thanks! I'm on holiday for a month so hadn't looked at it. I'll see what I can do from outback Australia!


so it isn't fatal

Friday, October 20, 2006

Tabax, Sidax and KR3

Just updated Tabax for work with Kernel Rollup 3 - see homepage for details

Sidax has been updated also:

  • MainMenu is cached now at first load - so you can work after Sidax start immediately (go 'about' tab for cache refresh button)

  • 'House'option: you can add any number of windows to the sidax: for example I prefer to run current project window inside it

  • When you click on minmized window in the 'window' tab of sidax it will be restored

Monday, October 09, 2006

Sidax 0.3.7 beta 5 -- AOT included

download latest beta of sidax. Changes

  • AOT included!!! thanx top IPv6 from AxForum: all problems with built-in AOT was resolved so you have a sidax with AOT in it

  • X++ calculator changes
      It can output objects and containers

      It gets sidax as parameter (try to run sidax.collapse())

      Small other changes


Tuesday, September 12, 2006

[ann] Sidax 0.3.6 -- X++ calculator; Go component

Download from axaptapedia

X++ calculator -- evaluate X++ expression or run X++ statement


Go component -- enter component name and choose concrete component from list. You can enter path like "\Data Dictionary\Tables\VendTransOpen"

Wednesday, August 30, 2006

AOT VSS Integration

History window
Just uploaded the project for integration Visual SourceSafe with Axapta to store AOT items.

We've used it for our current projects and it help us to find what and why changes was made.

I think it will be good to use something other than VSS, and it can be done - tool is based on the abstract classes, but now i have only VSS implementation.

Friday, August 25, 2006

GenerateParmMethods extension v2.beta

Just uploaded small fixes to the extension.

Read about the anges at axaptapedia, then download it if you like

Saturday, July 15, 2006

ATTN!!! SQL Injection possibility when using literals in queries

I've found a huge security hole in Ax 3.0 SP 4 + MS SQL Server (i don't know about other versions, but i think it is possible with other versions too)

If you have the following database connection options switched on, users can execute any SQL Server query using user defined filter.

So switch off:

  • Literals in join queries from forms and reports

  • Literals in complex joins from X++



Dont't use forceLiteras in production environment.

It can affect performance but will protect your data

Thursday, July 06, 2006

On toolbars

Palle Algemark has recently posted about toolbars imitation in Ax:

Custom toolbars in AX,
Activating a custom toolbar

I have something to add:
  • if you want to do something with selected AOT items - use LastAOTSelection class (it's an iterator for last selected AOT items)
  • if you want to do something with active form: sit on timer, get last active form from info class (method setLastActivatedForm),remember it it's not your toolbar form and use remebered value on button clicks

Tuesday, May 23, 2006

Undocumented syntax: raw strings in X++

While reading the Fred Shen post Create a method in runtime i discovered the undocumented feature of X++: raw (or verbatim strings). If you place @ before " you can:

  • do not escape escaping characters

  • make multiline string


so

str s=@"
test\test
";

is equivalent to

str s="\r\n";
s=s+" test\\test\r\n"


so it is useful when you want to make methods or AOT pathes (BTW why Fred uses string for pathers ("\\Forms\\Address\\Data Sources\\Address\\Fields\\AddrRecId") instad of raw strings (@"\Forms\Address\Data Sources\Address\Fields\AddrRecId")

see also

Sunday, May 14, 2006

ParserClass and KOAN

Just finished an article about a ParserClass and added the new tool named 'KOAN'. It shows the structure of X++ code and lets to play with ParserClass and ScannerClass easily.
KOAN Syntax Explorer

Saturday, May 06, 2006

Sidax 0.3.5

Now you can download it (20k).

  • if you press a small heart at the main menu you see only previously used menu items
  • you can move you settings between databases (see 'about' tab)
  • if you rightclick the project history you can delete projects from history nd copy names
  • small visual improvements

What is Sidax?

Saturday, April 22, 2006

Feed to read

Axapta specific



Other



  • .NET undocumented -
    if you interested in .NET, Office and other Microsoft technologies, subscribe to this

  • Martin Fowler - OOP, TDD, XP
    and other smart things

  • Joel - wise thoughts about software development,
    hiring of programmers, merketing and so on

Tuesday, April 11, 2006

Monte Carlo profiling

Axapta profiler is useful, but very slow (it can make your code 30x slower when enabled). So sometimes i use the following trick (it is like Monte Carlo method in math):

  • run the job being profiled

  • break it randomly and go to the debugger to see what is going on (Ctrl+Break then Shift+No)

  • if you break often in some place, it can be hotspot


PS. Maybe, I simply do not know how to deal with profiler well, but it is hard to me to estimate real timing from profiler output. Maybe anybody can provide some tips for this?

Monday, April 10, 2006

MVP

I've got an MVP award. The main cause is my activity in erpkb.com, russian wiki dedicated to MBS ERP's. I have written lots of small articles about Dynamics Ax programming and I am collecting all bits of information which I see in the web.

Thursday, March 16, 2006

The magic semicolon

Example


This X++ code compiles well, but have Two potential errors:

static void test(Args _args)
{
int axcoder, axcoder1;
axcoder=1;
axcoder1=2;
}

This code is fragile. Try now to add the new type called 'axcoder'. Introduce a new class with the name 'axcoder', for example.

You will get a syntax error.

The problem is that designers of X++ decide to:

  • allow variables and type with similar name (so it is not possible treate a type as a variable of the special type, lead to tableNum, classNum and other ...Num literals in X++, blocks to declare variables in any place of code and so on)

  • do not lookahead deep enough to resolve this collision - so you and me we both able to decide that axcoder is not a class name here, but X++ parser does not (i am not sure its an easy task, but i think it is possible)


There is a common workaround for this situation: add an extra semicolon after the end of declarations like this:

static void test(Args _args)
{
int axcoder, axcoder1;
;
axcoder=1;
axcoder1=2;
}

Now the code compiles well. But this is not the end.

Try to introduce a new class with the name 'axcoder1'.

Oops! One more syntax error.

The cause is the same.

Now let's split multivariable declaration to two;

static void test(Args _args)
{
int axcoder;
int axcoder1;
;
axcoder=1;
axcoder1=2;
}


This compiles well.

Conclusion


X++ developers didn't copy java accurate enough. The decide to reinvent the wheel so X++ is sometimes ugly. It allows you to compile code which become brocen if anybody introduce the class with a special name. I have seen examples of such fragile code even in sys layer code (see \Classes\SysLookup\lookupTableFieldRelation for example).

There are simple rules to avoid such errors:

  • don't use multivariable declarations

  • insert extra semicolon after declarations end (but you can ommit it if the first non-declaration is a keyword for example return)

  • dont use simple name for classes ('i', for example) which can be name of the variable in existing code


Note on style


I prefer to keep extra semicolon as the first character of line so it help to delimit internal fuction from the main function body:

void test()
{
void subFunction1()
{
// body of subFunction1
}
void subFunction2()
{
// body of subFunction1
}
;
// body of the main function
}

Saturday, March 04, 2006

Sidax 0.3.4 - user mode sidax

Changes in this version:

  • Its now safe to run sidax by end users -- checks for access to menuitems added; check for development rights at start removed

  • now you can setup project window titles and timings by editing the 'class declaration' section of sidax

  • window tab reflect window title changes

  • sidax now uses default menu of the user instead the main menu

Ideas: AxPath protocol

Imagine that you have an ability to create links to everything in axapta: forms, records, classes, busines objects (for example orders). You can insert that link in the web page or e-mail and your correspondent can click on this link and open the item you linked to from browser or email client. For example you open Purchase order 'P0002', click the 'copy link' button and send a letter with words "look at order P0002" and sombody who have received this message can simply click on the link to open this order.

This document describe proposal to introduce that kind of links read more..

COM in Axapta

Just published article in the Axaptapedia in answer to post in microsoft.public.axapta.programming

Wednesday, March 01, 2006

How to make Sidax autostart.

If you do this, Sidax will start, when you login Axapta.

Open class Info and modify the startupPost method. Replace yourUserID with the name you log in to Axapta.

/*
No SYS code must exist in this method
*/
void startupPost()
{
;
// ======== Sidax start: =============
// check for user ID and ask for confirmation
if(curUserId()=='yourUserID' && Box::yesNo('Run sidax?', DialogButton::Yes)==DialogButton::Yes)
{
// actually run sidax
TreeNode::findNode('\\Forms\\Sidax').AOTrun();
}
// ========== end of Sidax start =============
}


Note: If you want to skip question, just remove:

Box::yesNo('Run sidax?', DialogButton::Yes)==DialogButton::Yes)