This will find the earliest possible start (materials ready) for the selected operations. The material date on the orders are updated and the operations can be moved to the material date automatically.

Example parameter configuration


BOM must be completely modeled in order for the calculation to be realistic.

Only operations which consume material gets their material date updated.


After this macro, run the Schedule macro with setting “forward from material date”.

Parameter descriptions

(* = configuration required)


If true two features are enabled:

  1. If only a part of the amount consumed is available adjust the quantity consumed down to that amount. A confirmation dialog will be shown first.
  2. Instead of adjusting the quantity down the macro can also consume an alternative material. The user is prompted if the macro should adjust, use alternative material or cancel (don’t change). Two different strategies exist.
    a) The original material to consume can be (partly) replaced in a 1:1 (one to one) relation. I.e. 1 tons of primary material is replaced of 1 tons of alternative material.
    b) Pearson’s square. The original material can be (partly) replaced by two other alternative materials where the amounts are calculated by the Pearson’s square formular.

Example of strategy a:

The selected operation (order 87232) consumes 300 pieces of “RawMaterial” – see the pink graph where it drops from 200 to -100.

When executing the macro the original operation is adjusted down so it only consumes 200 pieces. Then an extra operation is created which consumes 100 pieces of alternative material.

Possible alternative materials are added on the “Materials” tab on the edit operation dialog and the “Disabled” setting must be checked.

Example of strategy b:

This strategy can be used both when there’s not enough in stock of the primary material and if there is enough in stock. The intention of this is simply to replace a part of the primary material consumption by a mixture of two alternate materials. This can be used where the raw materials have certain “dilutions” or “dry matter “. In the following example the primary material has a dry matter on 9 and the alternative materials a dry matter on 5% and 28%. If we want to replace a part of the primary material the macro can calculate the correct mix of the alternative materials to meet the dry matter % on 9. At present time the dry matter % is specified in the “Description” field on the material.

The alternate materials are setup in the “Materials” tab in the “Edit operation” dialog (double click on an operation).

In below example the primary material (yellow highlight) are set to consume 1000 tons. The two alternate materials are disabled and strategy is set to “Fixed”. The “Static quantity” is set to 0 on both of the alternate materials thus the user is prompted to fill in an amount on one of them. Thus it’s only possible to set an amount on an alternate material which has Static quantity set to 0.

So before running the macro it will look like this. The selected operation in order “87777” is consuming 1000 tons of Primary RawMaterial.

When executing the macro the user will get prompted.

It will only prompt if exactly two consuming materials exist with fixed strategy and at least one with static quantity set to 0.

If “Yes” is selected another prompt is shown.

The drop down menu contains the two alternate materials. Alternative B is selected.

Then we specify that we whish to force the operation to consume 100 tons of AlternativeMaterial_B. The amount for the other alternative material will be calculated using Pearson’s square. Furthermore the consuming amount of the primary material will get adjusted down corresponding to the sum of the consuming amount of the two alternative materials.

As a result a new operation is created before the original operation, consuming the two alternative materials and the quantity of the original operation is adjusted down so it only consumes 425 tons. The specified amount of “AlternativeMaterial_B” was 100 tons which is consumed, as illustrated on the graph.

The amount to consume of the other alternative material (A) is calculated to 475 tons, which can be seen on the first graph. As a result the original quantity on 1000 tons is retained: 100 (B) + 475 (A) + 425 (Primary) = 1000.

For more info about the calculations in Pearson’s square see Colorado State University link or make a Google search for “Pearson’s square”.

Default false


If true the quantity will be adjusted on order only and not on all operations in route.

Default true


If true producing operations will be planned to a time where there is enough available space in the warehouse to which it is producing. A maximum stock level must be configured for the warehouse.

Default false


The startCut and endCut defines the period where the macro should search for available stock. The search is very time consuming, so a period as narrow as possible is preferred.

If the endCut is reached without finding enough material in stock the operation is just skipped and a warning is shown in the log viewer.


Supported notation: “now” or “this week”- , y/year(s), m/mon/month(s), w/week(s), d/day(s), h/hour(s), min/minute(s) and s/sec/second(s).
The keyword “this week” corresponds to Monday morning at 00:00 in the current week. It is possible to add and subtract by specifying for instance ‘this w-3w+2d’ (or ‘this week – 3weeks + 2days’). Please notice that ‘m’ corresponds to month and NOT minute.

For a dynamic end cut you can use:

  1. current_opr_start
  2. current_opr_end
  3. prev_opr_end
  4. prev_opr_end_resgroup


It’s possible to add an offset to a dynamic parameter, i.e. “current_opr_start + 2days”

Default now + 6 months


If true any negative available space in a warehouse will be ignored when calculating the sum of available space.

Only relevant if checkAvailableSpace and ignoreWarehouseOnProducingBOMLine is true!

Default false


If true the warehouse on consuming BOMline will be ignored. The sum of material crossing all warehouses are considered

Default false


If true the warehouse on producing BOMline will be ignored. Instead The capacity of all warehouses in the resource group produced to is summed. Only relevant if checkAvailableSpace is true.

Default false


If one or more of the selected operations are members of an operation group – also run the macro on the other operations in those groups even though they are not selected.

Default true


Run the macro on all operations in a route even though the route is only selected partly.

Default true


If true the operations will be moved to the updated material date. If the selected operations consume the same material it’s advised to enable this setting – in order to achieve the most realistic result.

Default true


If true the selected, consuming operations will be moved to after the currently last operation in the resource group. And then scheduled with regards to the inventory level.
When finding the last operation in the resource group – all resource members in the current group will be analyzed in order to find the last operation.

Default false


This is used by the search algorithm and can be adjusted in order to reduce the time consumption. The optimum value is dependent of the nature of the plan. If the producing transactions (producing operations or purchases) produce linear over a long duration the value should be high – a rule of thump is app. half of the average duration in hours. If the producing transactions are not linear (countings or purchases with same start -and end date) the value should be set to 1.

Default 8


This is also used by the search algorithm and can be adjusted in oder to reduce the time consumption. This value is mostly concerning consuming operations which consumes with a linear access method i.e. linear over workload. Then by default the inventory is checked by every 10 minutes over the operation duration. In this case the material date can be up to 10 minutes later than the actual earlist available stock time. And also the stock level can go below safety stock over the operation duration because it’s only checked in 10 minutes steps.

The higher value the lower precision and thus less time consumed by the macro.

Default 10


If true a certain amount needs to be in stock before the consumption is allowed to start – however it’s alright if the inventory level gets below the safety stock as long as it don’t gets negative.

If false the inventory level must never get below the safey stock.

Hint: In order to create safety stocks go to “Edit->Materials” and select “Min/Max stock level” tab. Add a row and select the material. The “Min. level” will be respected as the safety stock in the macro.

Default false


If true the material date will be set to the same date as the startCut if not enough material is available.

Default false


If true the material date will be set to the operation’s end time if there’s not enough material in stock.

This is relevant if moveOperations is false i order to get the material flag warning.

Default false


If true override the material date on the operation otherwise it’s only set on the order.

If there’re multiple operations in a route the latest material date is always set on the order. However if this option is true each individual material date for each operation is also set on the operations.

Default true


The default setting (prev_opr_end) will cause the startCut to be dynamic and will be set to the previous operation’s end time on the same resource. If no previous operations exist time now is used.

Another option prev_opr_end_resgroup can also be used. This will set the dynamic startCut to the previous operation’s end crossing all resources in the resource group.

For other (fixed) start cut options see description in parameter endCut.


It’s possible to add an offset to a dynamic parameter, i.e. “current_opr_start + 2days”

Default prev_opr_end


Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment