How to enhance the Master Pack
Practical Technology Solutions, LLC created a customization inside Epicor®10 in the Master Pack application that allows for the processing of shipments in a semi-automatic and batch process. The enhancement allows for the closing, staging, and shipping of a master pack from three checkboxes added to the top right of the screen.
First, I added three checkboxes which are not bound to any fields. This is because the changing of the status is not tied to Booleans, but instead a single ‘Status’ field that changes based on Actions that are performed.
This document does not cover the importing of adapters or the use of ‘using’ statements please make sure you have an understanding of these concepts before continuing.
The first checkbox is the Closed checkbox. This checkbox is actually mimicking functionality found in the Actions menu of the Master Pack Shipment screen.
Here we can see the Open and Close actions inside the Actions menu, these Actions are related to F3 and F4 keystrokes. So for this checkbox I am mimicking the keystroke of those keys.
Our solution for this checkbox incorporates the event these are in via a CheckedChanged event. This will trigger every time the checkbox changes from checked to unchecked and vice versa. The ‘SendKeys.Send()’ is used for the actual ‘pressing’ of the F key, then updating of the checkbox and the EpiShape which is the red closed rectangle next to the checkbox. It is hidden until the checkbox is true. As you can see in the below code, if the status is ‘Closed’ when the closed checkbox is checked then it will ‘Open’ the master pack. All the checkboxes work in the way, both closing and opening, bother staging and unstaging and both ship and unship. What is interesting is that the close and open are done with just fake keystrokes, while the other two checkboxes (stage and Shipped) use a combination of fake keystrokes and adapters to mimic actions done outside the master pack screen.
Next is the Stage checkbox. Checking and unchecking this box will toggle the status from Staged to Closed (closed is the status after it is ‘unstaged’).
The Stage action is available in the Actions menu inside the Master pack screen so this again was accomplished by a fake keystroke
A partial screen shot of the code shows a keystroke of F7 Stages the master pack.
However, for the Unstaging of a master packing you will need to go to the Stage Ship Confirm screen to accomplish that. This would require a right click on the Staging area drop down.
Then once in the Stage Ship Confirm Screen you can select a row and use its Actions menu to ‘Unstage’
This was accomplished inside the Master Pack Screen by using adapter to mimic this process. By using a Trace I was able to find out what the adapters needed passed to them to accomplish the desired actions.
Then finally the shipping checkbox, which only uses the adapter method as both shipping and unshipping a master pack happens form the Stage Ship Confirm screen.
This was the most complicated action done through the adapter method. This declares a BO then steps through several methods inside that business object.
We found what needed passed to the methods by using the Trace feature and the Object Explorer inside the customization screen. Trace below was used to find the ship confirm values that needed passed.
This uses three checkboxes and three epishapes to updating/hiding/checking is all done with EpiViewNotifications and a switch statement. This allows the ship checkbox to only be available once a master pack is staged. As well as manage the color-coded shapes that appear next to the checkboxes.