This is another case study I gave during a development training class. The whole training went quite fast and trainees wanted another use case to work on. So here is the use case I suggested.

The USE CASE

  1. We start from an physical BOM (read the previous article to understand how this is done).
  2. On a physical Part, I want to be able to order a replacement Part, so I want an action "Order replacement".
  3. Once selected, it should open a popup with the potential part supplier references defined in the engineering BOM.
  4. Once selected, if the supplier already has an open order, it adds the reference to the open order. If not it will create a new order and add the reference.

manuf PhysicalPart Datamodel

The Methods

In order to implement this I need 3 different methods.

  1. A method called by the action which will:
    • Open a popup for the user.
    • Wait for the user selection.
    • Create or update the right purchase order.
  2. A method called on the popup load which loads the potential part references and fills the select box.
  3. A method called on the popup's "ok" button click to return the selected data.

1. Call Popup & Handle Callback

Open popup, wait for popup callback, and then update/create the purchase request.

gist.github.com/…/effdf001263fd6e605b0e89ad62c4abf

2. Load the Part Supplier List

Find the potential Part Supplier references and load the select box.

gist.github.com/…/66528ee83ba15573f02d8b2c9bf7d3a2

3. "OK" Button Click Event

Return the selected popup data.

gist.github.com/…/ee00a663a45b0338d9449831963be18c

Of course you need to create the popup form mentioned in the method.

And once again all this is developed in Aras methods so it is packaged and easy to maintain and upgrade!

LOOKING FOR MORE ARAS INSPIRATION?

Subscribe to our blog and follow @ArasLabs on Twitter for more helpful content! You can also find our latest open-source projects and sample code on the Aras Labs GitHub page.