Microsoft Dynamics Ax developer's blog

Showing posts with label axpath. Show all posts
Showing posts with label axpath. Show all posts

Friday, October 29, 2010

How to open a form in a running Ax client from an external application

Some times ago someone asks me if it possible to open form in running Dynamics Ax application with external code. He don’t want to use AxPath for some reason.
I recalled there is a similar thing in Ax (since version 4.0) – when you receive an event alert message you can click an a link and go to the corresponding alert.
The idea was to reuse alert handling code as much as possible. And I achieved that without changing Ax code at all.
How alert links work?
1. When you start Ax32.exe, it runs the EventDrillDownPoller class, that creates a named pipe with name like “Dynamics\Event\0S-1-5-5-0-686394” (you can use pipelist utility from the SysInternals suite to obtain exact name of your named pipe) where
  • Dynamics\Event\ – is a constant prefix
  • 0 – is a value from the “Drill Down target” field in the “Basic\Setup\Alert\Alert parameters” form
  • S-1-5-5-0-686394 – is a user system session ID
and then time is being initialized, handler of the timer polls named pipe and executes SysStartupCmd descendant when message received.
You can look at \Classes\EventDrillDownPoller\scheduledPoll code to see the details.
2. When you click on the link in e-mail, axhlink.exe protocol handler is executed, it parses url and connects the named pipe obtaining it’s name using “Drill down target” from url and current session id. Then it writes a command to the named pipe.
3. When timeout handler (which was subscribed to the times in 1.) detects there is a new message in the pipe, it just runs a SysStartupCmd and then recreates a named pipe (see \Classes\EventDrillDownPoller\scheduledPoll – unfortunately it uses the current company to detect a drill down target, so if you have different values of the field in different companies ad user changes the current company, you can see it recreating a named pipe with a different name – it can cause mistakes)
So the task is pretty simple
  • Create an autorun startup command configuration file
  • Connect to the named pipe using session id and provided drill down target
  • Write a zero terminated Unicode string with a startup command to the pipe
You can download code example here

Contents:
  • C# sources of sending a message  (command line utility that takes startup command and drop target ID)
  • XML file example
  • XPO with modification for autorun startup command code, adding a parameter to navigate to a specific record (that was additional requirement – it takes table and recID attributes)

Friday, November 07, 2008

AxPath plugin for Tabax which works with Ax3, Ax4, Ax2009

Now you can download AxPath.dll (with sources) which works with Ax 3, Ax 4, Ax 2009. Previously it worked only if Ax3 was installed.

Ivan fixed it to work with Ax2009, now I have extended it to probe registry keys for Ax2009, Ax4, Ax3 (in that particular order) and work with the version found first.

If you do not know what AxPath and Tabax are - look at http://axaptapedia.com/AxPath, http://axaptapedia.com/Tabax

AxPath plugin originated by AndyD from http://axforum.info

Monday, May 14, 2007

Tabax v 0.3

download (87k)

After the long period of beta stage, the new release of Tabax is out.


This release introduces several new features which will be very useful for developers and end-users

First of all, it works under version 4 of Dynamics Ax.

Second, it introduces the Tabax Plugin API which allows developers to increase functionality of Tabax sufficiently.

There is a plugin for Tabax (in the tabax archive) to integrate AxPath with your system: so, if you install this plugin, you can click on AxPath links in browsers and email clients and go to specific location in code or specific record in the database (thank to AndyD for this functionality).

Ivan Kashperuk has developed a great plugin named RecentWindows which I use heavily. If you close some window, it allows to reopen it quickly.

Also, Ivan added a very useful feature to Tabax: if You press the 'Edit current field' toolbar button, while holding Ctrl and Shift down, Tabax will open a table field or data method related to the currently selected form field.

I have added similar fuctionality to the 'cross referebces' buton - now You can press it while working with form, and you will see cross refereces for the fireld related to the active control.

There are also some minor bugfixes and enhancements in this release

Thursday, May 10, 2007

AxPath is supported by axaptapedia

So you can create links to AOT items in Axaptapedia using regular link syntax and if you have Tabax 0.3 rc 1 installed, you can navigate them.

Thanks to Andrew Jones!

Tuesday, May 08, 2007

Tabax 0.3 rc 1:

download (80K)

changes:

  • fixes bugs in AxPath

  • AxPath browser integration plugins is in archive in the extras folder

  • Plugin SDK documented

Wednesday, April 25, 2007

AxPath integration with browser email etc

With great help of AndyD, Tabax now have an integration with browser and other tools. For example you can send a link to the specific purchase order via outlook, and when the link will be clicked, user will see purchase order you linked to.

You can also link to the specific parts of code. For example here tabax checks your access to development environment when you are navigating AOT link.

How to make it work:

  • download the latest beta of Tabax
  • Install Tabax and Plugin SDL
  • download and install AxPath plugin. Run register.bat

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

Saturday, March 04, 2006

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..