AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.10.2010, 00:07   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
axcoder: How to open a form in a running Ax client from an external application
Источник: http://axcoder.blogspot.com/2010/10/...g-ax-from.html
==============

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)



Источник: http://axcoder.blogspot.com/2010/10/...g-ax-from.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
Dynamics AX Sustained Engineering: Performance issue in "Open Transaction Edit" form Blog bot DAX Blogs 0 26.10.2009 20:05
emeadaxsupport: How to open an AX form from your own help Blog bot DAX Blogs 0 26.07.2009 15:07
Khue Trinh: AX 2009 Quality Management - Quality Control Blog bot DAX Blogs 1 04.07.2008 16:01
axaptabuilder: How to build Axapta application from XPO files stored in Visual Source Safe. Blog bot DAX Blogs 0 12.04.2007 16:10

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:32.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.