‘Production order #### could not be scheduled. Not enough capacity could be found.’ - How to get to the bottom of this.

A few times already I’ve been asked to investigate customer cases that went something like this:

Create a production order for some item from the standard test data.

Schedule the order (job scheduling or operation scheduling, doesn’t matter).

Expected result:
The order gets scheduled.

Actual result:
Production order ### could not be scheduled. Not enough capacity could be found.

 

In some cases it turned out it was a product bug. In other cases the message was perfectly valid.

The question is: how would you, as a user, know what’s happening? How would you figure out why capacity was not found?

Ideally the scheduling engine should not only return a dull message saying that it didn’t find enough capacity. It should come up with a reason or a trace or something you could analyze. And we sincerely hope that in future releases we will get to enhance the error reporting of the scheduling engine! But until then, here is a list of things you can do when you get the error:

1. Check if there are any applicable resources that satisfy the operation requirements at the production order site.

Path:
Production order list page – chose the production order that can’t be scheduled – Production details – Route – chose the operation that’s causing the failure – Applicable resources – check if you have any applicable resource on the production order site


 

Img 1 – There are applicable resources, but none on the production site

 

2.  If it turns out that there are no available resources at the production order site, make sure you have resource requirements enabled for the type of scheduling you are doing: operations vs job.

Path: Production order list page – chose the production order that can’t be scheduled – Production details – Route – chose the operation that’s causing the failure – Applicable resources – toggle ‘Use requirements for’ between Job and Operation scheduling.

 

 

3.  Make sure you have calendars associated to the resources/resource groups identified as applicable and that the calendars have working times and that efficiency percentages are not 0.

Path: Production order list page – chose the production order that can’t be scheduled – Production details – Route – chose the operation that’s causing the failure – Applicable resources – for each applicable resource right click and or click
View resource – Resource form – Resource groups – make sure there is a Calendar associated with the resource.

If there is a calendar, make sure it has working times: right click on the Calendar and View details or Organization administration – Calendars – Calendars – chose the calendar – Working times and check the form is not empty or that the days don’t have Control set to Closed. Pay attention to the base calendars as well, and make sure they have working times and correct efficiencies and the days are not closed.

If the error occurs during Operations scheduling, make sure that there is a calendar on all the applicable resource groups.

In operations scheduling, the resource group’s calendar is used for determining the start and end times and dates for each operation. The resource group’s calendar puts a limit on how much time that can be operations scheduled for one specific
operation for one specific day in one specific resource group. For example, if the working time for a resource group on one specific date is between 8-16, one operation can’t put more load on the resource group than what can be fit into 8 h, no matter how much capacity that the resource group has available on that day. The available capacity can however limit the load further

 

4.  Due to performance reasons, the scheduling engine will only search for a resource for a certain time/number of scheduling conflicts encountered. Make sure that in Organization Administration - Setup - Scheduling - Scheduling parameters you
haven't turned on any of the scheduling parameters. If you did, try to change the values and reschedule the order.

 

5.  If you are doing finite scheduling, it may very well be that you really have no free capacity. To make sure this is not the case, you can either:

 

6.  Revert to doing infinite scheduling, by un-checking Finite capacity check box during scheduling.

 

7.  Check the available capacity on the resources/resource groups applicable for the operations that couldn’t be scheduled.

Path: Resources/Resource groups form, opened either by View details or from Organization administration – View – Capacity load or Capacity load, graphically and make sure there is available capacity.

 

8. And if none of the above worked, then you need to revert to more ‘serious’ stuff – doing scheduling engine diagnostics, by enabling logging. Here’s how you do it.

(Note: you’ll need to have extended permissions to some files and the AX database in order to perform this, so if you are a production planner, shop floor supervisor, etc you will need to contact your internal AX support person to help you)

First of all, you need to know that the scheduling engine can produce 3 logs:

  1. Log that gives you the full picture of all the input data that the scheduling engine will work with when trying to figure out the schedule for the production order: list of jobs/operations that need to be scheduled, applicable resources, scheduling constrains, etc

Log file name : Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Log\SchedulingDataModel_[funky_numbers_here].xml

It is pretty easy to read. Look at this log in order to determine if the correct input information is fed to the scheduling engine.

       2.  Log with all the available capacity slots that the engine receives for scheduling – we will not get into details about who is providing these slots and so on, what is important to understand is that basically these are the available resource working times, based on the calendars associated with the resources.

Log file name : Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Log\SchedulingSlots_[funky_numbers_here].xml

It is also fairly easy to read. Look at this log to see if the capacity slots that are sent to the engine make sense.

     3. Log with all the capacity reservations that the scheduling engine wants to make, that should be saved in the AX database.

Log file name: Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Log\SchedulingResults_[funky_numbers_here].xml

This is basically the scheduling result.

           

By default, the scheduling engine does no logging at all, so none of the above files will be created. So how do you enable these logs? You go to Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin, open SchedulingEngine.config and set:

UseXmlOutput = true, in order to generate SchedulingDataModel_[funky_numbers].xml

UseSlotsXmlOutput = true, in order to generate SchedulingSlots_[funky_numbers].xml

LogResults = true, in order to generate LogResults_[funky_numbers].xml

 

 

Don’t bother with LoggerEnabled and LogVerboseEnabled - they are there just for historical reasons and are, in fact, never used. LogToTextFile will be explained later.

Don’t bother to stop/restart the AOS – no need for that in order to enable logging.

Now, as soon as you schedule your production order again, you’ll get the log files.

These logs that you’ve just got are very generic, as you can see, so it would be a huge step forward for us if a ‘Not enough capacity found’ customer case had these attached!

I will not go now into detail about the fields in the logs, what they mean and so on – this will be explained in a future post, more technical. What you can do until then is play with different parameters, play with applicable resources, play with different route parameters and you will get a decent understanding, I believe.

So what does LogToTextFile do? Up until now we’ve produced log files that are decently readable by anyone. You can also enable the scheduling engine to log every tiny thing it does, using standard Windows event tracing. Here’s how you enable this!

 

  1. Go to Performance monitor (go to Run – type Perfmon.msc)

       2. Create a new User defined Data collector set. Give it a name to remember and follow the wizard.

       3.Chose Create manually

 
        4. Chose Create data logs – Event trance data

       5. Add a trace provider

 

       6. Chose Microsoft-DynamicsAX-Tracing

 

 

       7. Specify what you want to trace from AX, by clicking Edit. You want to choose MRP from the list of all keywords.

       8. Specify where you want to keep the log

  1. 9. And you’re done, just click Finish

      10.  Well, you’re not 100% done – you need to start tracing, by clicking start in the tool bar

 

If you now schedule a production order, you can view the trace in the standard Windows Event viewer – Action – Open saved log – open the log saved at the location you set in the wizard, in my case C:\PerfLogs\Admin\DAXTrace\[MachineNameHere]_20130116-000001

 

 And good luck keeping track of these!

What you could do to make your life a little bit easier is to convert all the messages into a .csv file, which you can open in Notepad and search for some keywords or something like that. You do this by running the following command:

tracerpt [location_of_the_trace_file] -o [destination_file] -of csv

 

 

 

Whatever you do, remember to switch off tracing after you’ve collected your data! You don’t want to keep on piling data you don’t need, not to mention that tracing always has a negative impact on scheduling performance.