Microsoft Dynamics Ax 2009 Repairs Module in Silverlight 4

Business Problem

Microsoft Dynamics Ax 2009 has a gap in functionality with regard to order management for repair orders.  MDSi has several equipment repair and configuration labs on site.  Customer equipment can be staged and configured or physically repaired and reconditioned.  While Microsoft Dynamics Ax 2009 does provide some of the functionality required to perform in-house repairs, it falls short in supporting the expanded workflow of a repair lab.  Repair orders needed to be tracked, labor costs tracked, and part/item inventory locations need to be updated in Ax to reflect where the parts are located based on workflow transactions.  For example, if a repair technician brings a part to his/her workstation and marks the repair line as in process, Ax needs to be updated to reflect the inventory has been transferred to the repair technicians ‘bin location’.

Solution

The solution was to fill the gap with a Silverlight 4.0 line of business application that will provide a simple user interface that allows warehouse workers and technicians to simply change the status of a repair line.  The application will perform the necessary inventory movement journal transactions to move the part from staging bins to in process and finally to complete warehouse bins.  If a part is successfully repaired a sales order is generated to allow for the invoicing of the repair.  If the repair cannot be completed, a disposal order is created.

AllRepairs

All repair orders show in the main view.  Users can filter or group using the data grid.  From this view the user can also view the repair lines of a repair order and edit the details of a repair order.

RepairOrderDetails

Creating or editing a repair order is accomplished through the screen above.

RepairOrderDetailEdit

Editing the details of a repair line displays a modal view.

PostPickingList

Warehouse personnel can pick the repair lines that are awaiting staging.  The above view shows all the repair lines that were picked by user dsandor.  From here, the user can print repair labels for the items and post the items.  When the user posts the items it indicates to the repair technicians that there are parts in the ‘inbound’ repair staging bin location.  Technicians will retrieve the items from the staging location and indicate the part is now ‘in repair’ which transfers the part in Ax to the tech’s bin location.

This project was developed in Silverlight 4.0 and C#.  It leverages WCF Services and SQL Server 2008 R2 T-SQL Stored Procedures to query data from Microsoft Dynamics Ax 2009.  Create, Update, and Delete operations are performed by interfacing with the .NET Business Connector for Dynamics Ax.  The application uses the MVVM design pattern and was developed in little over one week.

RFID Client for Spares Management

Business Problem

Large companies have lots of facilities which need spare part inventory on hand.  Facility operators may not reorder parts in a timely fashion which can lead to a local shortage of equipment.  Some facilities may hoard equipment creating a local surplus of equipment.  Both extremes are costly to a company.

Solution

Provide a simple to use touch screen computer that detects when a part is leaving or entering the spare parts room.  Upon detection of the part the touch screen computer displays a ‘tag’ with information about the part.  The facility user can touch the tag on the screen and note the use of the part.  When parts come in for replenishment the facility user can notate the put away location of the part.  When are part is used inventory levels at MDSi are updated.  If the minimum stocking level is reached a reorder is automatically generated and shipped to the facility to keep the stocking level true.

Components

RFID Client (Touch screen workstation)
This is the device with which the facility users interact.

image

The client is built with Microsoft .NET Framework 4.0 and uses Windows Presentation Foundation (WPF) to present the UX.  The client leverages the Model-View-ViewModel (MVVM) architectural pattern and is written in C#.  Communication to the home office is provided via WCF services.

image

RFID Tags are read via a Motorola XR-450 tag reader.  This reader was selected because it has a built in Windows CE operating system that allows us to write Mobile Embedded .NET applications to interact with the reader and with our WCF Services.  The RFID Client Workstation has a Windows Service written in C# and .NET 4.0 which continually polls the XR-450 reader for new tags.  The service exposes a .NET Remoting service which is consumed locally by the client UI.  Multicast events are thrown and the client system can respond to new tags accordingly.

RFID WCF Services
All RFID Clients communicate to a set of centralized web servers in an NLB farm.  The WCF Services provide a data exchange layer which provides caching by leveraging the AppFabric Cache feature of Windows Server 2008 R2.  Data is stored in a SQL 2008 R2 Cluster and the data is organized through Microsoft Dynamics AX 2009.  X++ and Business Connector code was created to interface through the ERP system and pass through all of the business rules configured in the Dyanmics Ax system.  In addition to using the .NET Business Connector and custom Dynamics Ax projects to manage the data, ADO.NET, Linq and C# is used in the creation of these services.

RFID Management Display
A Network Operation Center (NOC) application was created to provide real-time node (RFID Touch Screen Client) availability data.  This data is organized on a map and allows an operator to drill in to a workstation and remotely manage the system.

image

RFID Warehouse Printing
Tools were created to interface with the Microsoft Dynamics Ax 2009 ERP system which allow a warehouse employee to print RFID labels for items being shipped out for replenishment.  This system interfaces with the Zebra RZ 400 RFID Printer.  This application was created using WPF, WCF, MVVM.

image

RFID On-Site Inventory and Auditing Tool
This application allows a warehouse specialist to audit a sparing facility.  This application is written using WPF and .NET 4.0.  The application consumes the same WCF services provided for the RFID Client to connect to the ERP system.  The application allows a specialist to print labels via a wireless Zebra RP4T RFID Label printer.  Using this application a project coordinator can determine what inventory is needed on site and what can be returned for general usage to the Distribution Center (DC).  This allows for a quick and efficient auditing process.  The warehouse specialist does not need to know anything about the product, just scan the serial number and the application tells the specialist the disposition of the part based on the Min/Max settings in the ERP system.

image

RFID Node Creation Tool
The Node Creation Tool allows a support engineer to provision a remote RFID Touch Screen Client from a central location.  A support engineer can provision all of the standard configuration settings for Development, Test, and Production from the single tool.  This application was created with WPF, C#, WCF, MVVM.

image

RFID Online Spares Management Web Application
A Silverlight application was created to provide scaled down functionality for locations that do not have the RFID Touch Screen client installed.  Some locations need the ability to consume, count and audit their inventory without an RFID client.  In this case a laser barcode scanner is used to scan the RFID barcode.  This application was written in Silverlight 4.0, uses WCF Services, and employs the MVVM architectural pattern.

image

Silverlight Hover Button – XAML Style implementation with code that is dynamic and skinnable.

So I needed to create a hover button.  The idea is that when the mouse rolls over the button the image will flip between a normal and ‘over’ version of the button image.  This is the same thing as old school image rollover code we have all used before.  There is an image that you use for a button in the ‘normal’ or ‘off’ state and when the mouse rolls over the image the picture changes to the ‘over’ or ‘on’ state.

It is pretty easy to do this statically.  Edit the button style, slap a couple of images in the ControlTemplate and tie that to the Normal and MouseOver visual states and you are done.

But what if you want to be able to use that same style for all your buttons and you want to be able to databind the Normal and MouseOver images?

This was pretty easy with a trick here or there.

First, we need to create a HoverButton class that inherits from the standard Button.  We need to do this because we need 2 new properties for our Normal and Over image url’s.

This is the button you will place on your design surface instead of the regular button.  This one gives us NormalImageUrl and the MouseOverImageUrl.  These properties we will set to the URL for the images we want to use for our normal state and mouse over state.

Next is the Style (see the zip file at the bottom of this post for the actual code).  Since the Style is so big, I will describe the important pieces to you.

First, your XAML that contains this style code needs to have a namespace reference to the HoverButton’s namespace.  I named mine local so you will see my TargetType set to local:HoverButton.

So the style starts out like this:

Note the TargetType in both instances is pointed to the local namespace and the HoverButton class name.  The real magic occurs in the ControlTemplate portion of the code.  Here there are several Visual States defined.  We are concered with two of them (feel free to extend this to the others also): Normal and MouseOver.

You will notice in each of the two Visual States we are concerned with there is a storyboard.  The StroryBoard executes when the visual state is entered.  So for example, when the button starts out it is in the Normal state.  When the control is rendered the Normal visual state causes the storyboard defined here to execute:

 

What happens here is that the StoryBoard sets the OverImage’s Visibility property to Collapsed and the NormalImage’s Visibility property to Visible. 

Before confusion sets in, scroll down to the bottom of the style.  You will see the two images we just discussed.

The two images defined inside the button’s visual surface are the actual images you will see at runtime.  Notice that we had to set the DataContext of the Image control to the property NormalImageUrl and MouseOverImageUrl and THEN set the Source property to {Binding}.  You need this little trick in order to allow databinding to convert the string based URL to an ImageSource.

So now we are good to go.  We can use our HoverButton like this:

So now you can specify the Normal and MouseOver images for your button.  The same style can be used for all these hover buttons, just specify the 2 images and you are set. 

 

Download File – HoverButtonSource

 

 

 

 

 

 

Serialize and Deserialize in Silverlight ( XmlSerializer does not exist ).

Many thanks to Einar Ingebrigsten!  I needed to serialize and deserialize some configuration data in one of my Silverlight projects I am currently working on.  This really came in handy:

http://www.ingebrigtsen.info/post/2008/11/29/Serialization-in-Silverlight.aspx

The executive summary is that you can use the DataContractSerializer without the need for DataContract or DataMember attributes.  Einar even gives you some sweet helper methods for Silverlight to make your life even easier.

Solved: Cannot resolve TargetProperty (UIElement.RenderTransform).(CompositeTransform.TranslateY) on specified object.

I was using Blend 4 to do some simple animations then copy and pasting the storyboard for use on other objects in my application.  When I executed the Begin() method on the storyboard I would get the following:

Cannot resolve TargetProperty (UIElement.RenderTransform).(CompositeTransform.TranslateY) on specified object.

My XAML was pretty basic.  I finally noticed that Blend had populated the RenderTransform property for me on the working objects.  When I cut and pasted and updated the target object I failed to add the render transform.  Doing so fixes the problem:

Working:

Not working:

So if you get this message it is basically telling you that you are missing the RenderTransform property on the target object.