Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What handles dynamics:// URLs?

I'm trying to create my own custom drilldown functionality, where a URL dynamics://0?myfunction_123456 will launch my own code.

In C\SysStartupCmd\construct, this base code:

    case 'viewalert':
        sysStartupCmd = new SysStartUpCmdViewAlert(s,parm);
        break;
    case 'drilldown':
        sysStartupCmd = new SysStartUpCmdDrillDown(s,parm);
        break;
    case 'viewalertrule':
        sysStartupCmd = new SysStartUpCmdViewAlertRule(s,parm);
        break;

I've tested and these all get fired with these URLs:

  • dynamics://0/?DrillDown_382576
  • dynamics://0/?ViewAlert_382576
  • dynamics://0/?ViewAlertRule_382576

However, if I add my own case, leaving all other code the same, I can't get the URL to fire:

    case 'myFunction':
        sysStartupCmd = new SysStartUpCmdDrillDown(s,parm);
        break;

I've dug all over the system and can't figure out what causes the dynamics:// URL to only fire for those three cases. Is there a registry entry or something? I've found C\EventDrillDownPoller which appears to create a PipeServer to maybe handle what's incoming?

like image 755
Alex Kwitny Avatar asked Jan 23 '14 17:01

Alex Kwitny


People also ask

How does a dynamic URL work?

What is a dynamic URL? If the content of a site is stored in a database and pulled for display on pages on demand, dynamic URLs maybe used. In that case the site serves basically as a template for the content.

What are dynamic URLs?

A dynamic URL is a page address that results from the search of a database-driven web site. Dynamic URLs are the URLs that are generated by a server or a content management system and are not easy to remember. These are created because the server or CMS doesn't know what to call each page.

How are URLs generated?

Dynamic URLs or dynamic sites are generated at the moment a user submits a search query. Unlike static websites, they are not stored as a whole on the relevant server, but are generated with the stored data on the server and an application.


2 Answers

Of course, I figure out my own answer every time I type up a stackoverflow question, but I think the information is really useful.

This stack question led me to find out that C:\Program Files (x86)\Microsoft Dynamics AX\50\Client\Bin\AxHLink.exe %1 handles Dynamics:// URLs.

Which led me to Microsoft's community forums where somebody else was facing a similar problem as me.

So the solution would be to either:

  • Create custom a URI handler with C# or some other language to communicate to AX (Similar to this)
  • Hi-jack one of the 3 handled existing cases with some custom X++ code to try and fork off of it. Perhaps by changing the drilldown target in the URL and handling that way, or appending some special characters to the string.
  • Call "c:\Program Files (x86)\Microsoft Dynamics AX\50\Client\Bin\Ax32.exe" -startupcmd=myfunction_myParams and make that a clickable link.
like image 166
Alex Kwitny Avatar answered Sep 28 '22 14:09

Alex Kwitny


You have answered your own question, but it is quite easy (if you know how) to hook on the standard DrillDown code to customize AX to start a specific form like:

Starts AX on item 03310511 in company XXX

start dynamics://TEST/?DrillDown_0?table=InventTable&field=itemId&value=03310511&company=XXX

It will assume reasonable defaults.

start dynamics://TEST/?DrillDown_0?table=CustTable&value=113545

And AX can be called from a HTML e-mail, assuming the receiver has an AX client!

<a href="dynamics://TEST/?DrillDown_0?table=CustTable&value=113545">113545</a>

You find my customization in my pastebin.

like image 27
Jan B. Kjeldsen Avatar answered Sep 28 '22 16:09

Jan B. Kjeldsen