Sales order totals

Sales order totals

In the course of a Dynamics 365 for Finance / SCM (aka Operations aka Dynamics AX) implementation the sales department often asks for a quick sales order totals display, right in the sales order grid. A mature consultant instantly refuses with an argument a ‘display column’ is heavy on the database, the screen refresh is going to be slow, the calculation is oh so complex and so on.

Interestingly, for about a year there has been an out-of-the box solution by Microsoft. It apparently facilitates the two-way synchronisation through the Common Data Service (aka CDS, aka Microsoft Dataflex Pro) between Dynamics 365 SCM and Dynamics 365 for Sales (aka Microsoft CRM; I should have used my sarcasm tags).

The solution is deadlock-proof and safe in the terms of performance: a separate batch job populates two tables SalesOrderTotals and SalesOrderLineTotals related to the sales order headers and lines, respectively. Only the recently updated sales orders are considered. Contrary to the usual SO totals form, the total amount includes both the invoiced and backorder lines. 1000 sales orders ~5 lines each get processed in around 20 minutes in a production environment. The drawback is of course that the totals display is not immediate.

  1. Run Sales and marketing / Periodic tasks / Calculate sales totals, specify how many days should the routine look back for the “touched” orders:
  2. Check the table browser for results https://xxx.operations.dynamics.com/?mi=SysTableBrowser&tablename=SalesOrderTotals
  3. Extend the sales order screen to OUTER-JOIN the Sales order totals table and display the totals,
    or use the joined table in query conditions in complex scenarios of the automatic confirmation, invoicing, etc:

SplitterDistance must be between Panel1MinSize and Width – Panel2MinSize

SplitterDistance must be between Panel1MinSize and Width – Panel2MinSize

On the first attempt to connect to the Visual Studio Professional 2015’s Team Explorer on a brand new virtual development machine for Dynamics 365 for Finance many of us have been taken by surprize by the notorious “SplitterDistance must be between Panel1MinSize and Width – Panel2MinSize.” error message.

The Internet has a few tips https://stackoverflow.com/questions/33845414/… more or less useful, and the true reason is this: VS 2015 UI does not manage the high resolution well. Most of us will use a full-screen RDP connection to the virtual machine, Windows takes the native resolution of your notebook by default, passes this to Visual Studio and this leads to the said error message. The full HD resolution of 1920 x 1080 already means trouble.

The solution is simple:

  1. Sign off from the VM.
  2. Change the RDP connection settings from the fullscreen to 1024×768.
  3. Sign on to the VM.
  4. Start Visual Studio and connect to the Team Explorer for the first time.
  5. Close Visual Studio and let it save your preferences.

Next time, the error message will not occur even when connecting to another DevOps server.

Semi-finished goods in an advanced warehouse

Semi-finished goods in an advanced warehouse

The management of semi-finished goods in the Production control module in Dynamics 365 SCM is notoriously messy in conjunction with the WHS (warehouse management), see my blog Missing flushing principle. The challenge is posed by the system if the material flows on the production shop floor do not require license plate handling, i.e. if people only need scanners to pick raw materials from the warehouse, but do not need them when passing semi-finished products from one working station to another. It becomes even harder if production orders overlap, i.e. if the downstream production order relies on a constant inflow of semi-finished orders and is started shortly after the upstream production order.

Preamble

We evaluated various scenarios:

  • a separate non-advanced warehouse in production is awkward, because every demand of raw materials results then in a transfer order which is a substantial overhead both in shipping and receiving. Moreover, transfer order put away directives do not ‘sense’ warehouse locations with material shortage, i.e. you cannot ‘aim’ multiple work station locations in one transfer order. Managing multiple transfer orders to different logical warehouses is even a greater overhead compared to a warehouse production picking wave, which flexibly consolidates all picking work for a production order or even for a set of production orders;
  • withdrawal Kanbans are awkward, because they require standalone rules for every material and every workstation. Managing BOMs is much easier than managing Kanban flows and withdrawal Kanban rules (where you don’t even have a data entity to import or update them in bulk!).
    Moreover, Kanbans do not ‘sense’ locations either, and rely on the MRP to trigger them. But the master planning usually does not consider the warehouse location level: if you do so, this renders the advanced warehouse management obsolete. We end up with logical warehouses per machine again. Finally, the MRP is not instant, the master planning may run for hours, but you need the material now!
  • phantom sub-assemblies do not invoke any movements at the warehouse and remain a viable and very safe alternative: the first inventory transaction will be at the very end of the last machine in the chain. This approach is not always possible (at least no at all stages in production) if the factory is required to count WIP items or builds up a safety stock of them.

The approach described below uses classic BOMs and production routes in combination with work policies or automatic work. Every route has a resource (machine, work station), and every resource is associated with one inbound and one outbound warehouse location. Materials in the BOM are marked for Resource consumption i.e. to be consumed from the inbound location of the respective machine. Provided that the locations are NOT license plate controlled, the warehouse management module may be configured to automatically pass the semi-finished materials from one location to another.

Converging or sequential material flows

Consider the following scenario: whatever the semi-finished products are, one machine supplies with them just one downstream machine. Or 2 or more machines feed together the next one, and the path never changes. In this case, the output location of the upstream machine can be defined the same as the input location of the downstream machine.

In the below example the outbound location of the machine 145 equals the inbound of 146: O145 = I146.
Converging material flowsThe inbound and outbound locations are set for a resource (Production control > Setup > Resources > Resource) in connection with a resource group. The group in turn specifies the [advanced] inbound and the outbound warehouses, which are normally the same (unless it’s subcontracting).
Resource locations

However, on an attempt to select a non-license plate controlled warehouse location (the one where in the Location profile the parameter Use license plate tracking = No) for the output, a warning message comes up: “A work policy does not exist for location %1. A work policy must exist for a non-license plate controlled output location”.
Indeed, a work policy must be created first to inhibit any put-away work on reporting products as finished into this location:
No put work policy
An unprocessed put away work is bad even if it points into the same location I146 -> I146, because it reserves the semi-finished product and makes it unavailable to the next machine. With the above policy no put-away work is going to be created out of the location I146, the material is reported as finished into this location and stays there, ready to be reserved and consumed by the downstream resource.

Diverging material flows

Forks in the material flow make it much harder to configure. For example, if one resource may feed different downstream resources depending on the context, then the above setup with a work policy is not going to work.
Diverging material flows
In short, one needs 3 ‘ingredients’:

  • a Work template with an automatic processing;
  • a specially prepared Location;
  • a set of “put” Location directives (“pick” directives are not necessary, because the picking location is always dictated by the resource).

The Work template (Warehouse management > Setup > Work > Work templates) for the Finished goods put away work order type should have a typical Pick-Put pair, the Automatically process flag (!) set and a distinct Query to react to pre-defined semi-finished products.
Work template for Automatic processing
Bear in mind that (1) the automatic work processing requires a Default work user ID in the Warehouse management parameters; (2) the automatic work processing fails if the product is serial number controlled; (3) a number sequence for the license plates must exist: the system is going to take a temporary target LP.

The Location should not be license plate controlled, because if it was, the production worker would have to manually select a distinct LP on the Report as finished or the Manufacturing execution Feedback screen.
However, such a location cannot be selected in a resource, as we know. On the one hand, you don’t wish to have license plates, on another hand you need an automatic put away work to a certain location, and a prohibitive put work policy is not an option anymore.
This is not intended by Microsoft to work, but one can trick the system into it. First, assign a LP-tracked profile to the output location, and select it in the resource. Second, change the profile of the location to a Non-LP-tracked one!

The Put Location directives (Warehouse management > Setup > Location directives) for the Finished goods put away work react to certain products or resources with the help of the directive header Query (one can join the production table with the production route in the query) and divert the automatic put operation from one location to another:
Putaway location directives
The target location is “hardcoded” in the Location directive action Query.

Let the worker report the production order as finished: the system creates and executes put away work despite the missing license plate. One product goes ‘left’ and another goes ‘right’ from the same station fully automatically:
Automatically executed work

Conclusion

It is possible to “hard-wire“ a certain material flow between machines into the Warehouse management. Overlapping production orders remains a nuisance, because BOM lines do not exhibit a location if the warehouse is an “advanced” one. The input location of the machine is derived dynamically and the WHS module works through the reservation: the raw material must be reserved in the inbound location prior to consumption. But how do you reserve a material if it did not exist as you started the downstream production order?! The orders may be chained by the “Pegged supply” or automatically “re-released to warehouse” every X minutes.