Dynamics NAV 2009 Sp1 Client Add-ins
When Service Pack 1 was released for Dynamics NAV, it introduced a new feature: Add-ins. I had read the walk-through and was thinking of something useful to build that would utilize the Add-ins feature. Last week a salesperson emailed me and asked me if anybody had migrated the Graphical Process Flow Chart Tool that Microsoft had released. Here is the URL.
I imported the fob and loaded the objects into a 5.0 database and looked at how the demo was built. The Visio diagrams are saved as pictures and a form with Visio picture at the back and NAV buttons displayed on the form.
Here is a screen shot. The background window show the form when you run it, and the front window is the form in design form. It’s a very simple demo.
I created a new visual studio class project following the walk-through in the following link. It was useful in getting me started with building a working Add-in that rendered a text box.
There are many solutions on how to render the Visio diagram in Role Tailed client. I tried to use the Visio control but couldn’t get it to work. I saw in the Demo VPC the Visio diagram, and it would be nice if they blog about it. The other solution is to save the visio as html file and render it in a browser. For demo purposes I thought staying with bitmap solution would be sufficient, so I decided to stay with the Bitmap solution.
I created a PictureBox control and display a blank image on opening of the page. After the Page is opened, I saved the image on the RTC temp directory and send the Image location to the add-in be loaded on the Page. My demo solution is implemented in the following steps: Display an Empty PictureBox. Load the Image from a blob field from NAV. Handle and send mouse event coordinates to NAV. Handle mouse click event and send it to NAV. Communication from C/AL is done through modifying the SourceExp assignment which calls Value Set function. The Add-in is used 3 times to load 3 different images on same page, and user can click on any areas and specific Dynamics NAV page will load.
For example; if they click on Purchaser icon, it will open The Salesperson/Purchase Card.
Here is a screen shot of the results. While moving the mouse over boxes, the mouse icon changes to a hand letting the user know that it’s click-able.
The handling of Coordinates and business logic are done in NAV. In My example I’ve hardcoded the locations in code, but could be moved to a setup table and made more dynamic so that you could build a variety of solutions. For example build a touch button calculator.
Or display a restaurant diagram that the user can click on and open the specific table. Or have a warehouse Image that loads the specific bin.
The mouse position/ coordinates are sent to NAV, thus you can have a setup table to do specific tasks based on the coordinates.
I’ve attached the demo.zip file that you can download and use it for demos or for future solutions.
I’ve also attached the Visual Studio Project with source code.
*This post is locked for comments