The SSRS warmup class in Dynamics AX

Thanks to my colleague Frankie Zhao for giving me this one.

We’ve all noticed that the first time you do something in Dynamics AX it takes a bit longer than normal – and in the case of an SSRS report that bit longer can be quite a bit longer, so I was pleased to come across the SSRS warmup class a while ago.

See the TechNet details here.

Unfortunately, I didn’t carefully read the whole article, because the first two sections talk about how to setup a batch group and a batch job – and I didn’t think that that was particularly complex:

In Dynamics 365 for Operations: System administration > Setup > Batch group In AX 2012: Systems administration > Setup > Batch group
In Dynamics 365 for Operations: System administration > Inquires > Batch jobs In AX 2012: Systems administration > Inquires > Batch jobs > Batch jobs
New:

File > New:

Batch job > View tasks:

View tasks:

New:

Ctrl-N / File > New:

And add the row:


Note the name of the class is SrsReportServerWarmup.

And add the row:

Then define a recurrence, (for instance run on each working day at 7:45am).

Batch job > Recurrence:

Recurrence:

And finally change the batch job’s status to ‘Waiting

Batch job > Change status:

Functions > Change status:


(Just click on the required status).

So, imagine my disappointment that after setting this up in a brand shiny new Dynamics AX implementation, I logged in first thing in the morning and noticed that the main report that the users were going to use didn’t actually open any faster than normal.

And the reason is staring us in the face in the TechNet article:

When the SRSReportServerWarmup class runs, it prepares the report server for use by running a sample report that is named SRSReportServerWarmup. You can customize the SRSReportServerWarmup class so that it runs additional, specific reports.

For example, assume that Phyllis, the Accounts Payable manager in your organization, runs the Vendor Aging report every morning. To ensure that this report renders quickly for Phyllis, you can customize the SRSReportServerWarmup class so that it runs the Vendor Aging report every morning. To do this, you’ll need to create a new method that runs the Vendor Aging report and then configure the SRSReportServerWarmup class to call this new method.”

What this job does is to save a copy of the report ‘SRSReportServerWarmup.AutoDesign’ to a PDF file in the system’s temporary directory, but your user’s won’t really derive any benefit from this job unless you customise the class to run those reports that the users actually run. However, beware that you aren’t exposing any sensitive data by creating a file in a folder that everyone has access to, so give some thought to the parameters that you use to run your warm-up reports.

Advertisements

Vendor calendars in Dynamics AX

“Can we group planned purchase orders by order date?”. This question came up in a Master planning workshop the other day. The buyers have a weekly / monthly routine. For specific vendors, every couple of weeks or so they’re raising purchase orders by vendor.

My first instinct was to think about Vendor calendars – but I’ve never used them, so some investigation was in order – and here it is.

In Dynamics AX you can add a calendar to a customer, vendor, warehouse, coverage group and resource (work centre). The purpose of the calendar is to define working days – AX uses the terminology ‘Open’ or ‘Closed’ for a working day, and for a resource the calendar defines the number of working hours for the day (and optionally some other stuff like Efficiency percentage and Property).

In AX7: Organisation administration > Setup > Calendars > Calendars In AX 2012: Organisation administration > Common > Calendars > Calendars
Working times: Working times:

So we’re going to create a calendar that has most of its days closed, and an open day every second Tuesday. We’ll start with a working time template – and as the working time template only works on a weekly pattern we’ll define one where every day is closed. So I just create a working time template called ‘NONE’:

In AX7: Organisation administration > Setup > Calendars > Working time templates In AX 2012: Organisation administration > Common > Calendars > Working time templates

Now I’ll create a calendar called VENDOR1, and use the Working times > Compose working times to fill in the days

In AX7: Organisation administration > Setup > Calendars > Calendars >
Working times > Compose working times
In AX 2012: Organisation administration > Common > Calendars > Calendars
OK gives: OK gives:

And now I have to go and Open those days that I’d like my orders to be scheduled for. In practice, you’re going to want to open the Calendar working days in Excel, or use the Data migration framework to update these days:

I’ve setup a 2 raw materials with lead times of 19 and 27 days, and simulated lots of demand on them, so that we get planned orders for every working day:

In AX7: Master planning > Master planning > Planned orders In AX 2012: Master planning > Common > Planned orders

Ok – let’s add the calendar we prepared earlier to our Vendor.

In AX7: Procurement and sourcing > Vendors > All vendors > [Select] > Edit
In AX 2012: Procurement and sourcing > Common > Vendors > All vendors > [Select] > Edit

Now, re-run master planning and take another look at our planned purchase orders:

Both the Order dates and the Delivery dates are falling onto our Vendor Purchasing calendar Open days – I confess I’m surprised by this. I was expecting the Delivery dates to fall onto the open days, but not the Order dates. So let’s take ‘Yes’ for an answer and move on.


Master planning messages in Dynamics AX 2012

I’m going to have to do this post again, because there are changes here in AX 7 / Microsoft Dynamics 365 for Operations, but for today let’s stick with the cosy old AX 2012 version.

As usual I’m working in the Demo Hyper-V image (AX 2012 R3 CU9).

I want to demonstrate the messages raised by master planning when things don’t go to plan.

In his wonderful books on managing your supply chain in Dynamics AX, Dr Scott Hamilton talks about the three types of messages that you get from master planning: planned orders; futures messages; and action messages.

You get planned orders when your demand exceeds your supply. Here I’ve created a finished goods item, and I have a sales order (demand). There’s no stock on hand, so master planning gives me a planned production order (supply):


I’ve firmed the planned order and created a purchase order for my raw materials.

My production order starts on 13th December and ends on 20th December:


And my purchase order has a delivery date requested of the 13th:


So let’s enter a vendor confirmed delivery date that’s a few days late (15th) and run master planning:


We’ve got a Futures message on the production order, and an Action advance message on the purchase order line.

A futures message is telling you that your supply is late relative to the demand. If you don’t expedite, and if you take your full production lead times you will deliver late against the demand. You can see all the futures messages at Master planning > Inquires > Coverage > Futures messages details:


Notice that I have futures message on the raw material, but it refers to the production order, and not to the purchase order – and I have two futures messages on the finished goods item: one related to the production order and one related to the sales order.

In a real world environment, you could have hundreds of messages, so logically you’d filter down to the most important messages. For instance, you could be getting a futures message flagging that a production order was late, but the demand is sales forecast or safety stock – that’s not necessarily going to give you an issue – so let’s use the Filter tab to focus on Futures messages for sales order lines:


Gives:


Now we can resolve this message in one of two ways – we can either negotiate a delayed delivery with our customer, or we can expedite the supply (negotiate an earlier delivery of a purchase order or reschedule a production order). Either way, the futures messages for sales order lines give you a good place to start.

But if we’re a buyer, the futures message on the raw material isn’t much use to us. For a more useful message we have to go to Master planning > Inquires > Coverage > Actions:


Again we’re going to want to use the Filter tab to show messages related to Purchase orders. You might be tempted to filter for ‘Advance’ messages as well, but be careful, there are multiple action messages, and so you might get combined actions like ‘Advance + Increase’. It’d also be good if this form showed the vendor – so you might want to customise this form.

Let’s go back to our earlier example of a purchase order being delivered late:


If your delay takes the purchase order outside the ‘Negative days’ time fence, then the system will raise a planned purchase order (providing that your original purchase order isn’t marked to the demand), and it may raise cancellation messages on the original purchase order – if it can’t use the original purchase order to satisfy other demands:


This never seemed to me to be a plausible scenario – how is your vendor suddenly going to be able to supply a new order before one that is already promised to you? For this reason, I prefer to set negative days equal to the coverage time fence, which means that the system will always use the existing orders as supply and never raise a planned order unless the supply is insufficient for the demand.

So back to our three types of messages that you get from master planning: planned orders; futures messages; and action messages. Let’s try to put these into a priority for action.

1. Planned orders.

You’ll action these first because they’re telling you that you don’t have enough supply – except that you’ll filter by the order start date (for a planned production order that’s the date you’ll start your production; for a planned transfer order that’s the date you’ll issue to the transfer order; and for a planned purchase order that’s the date that you will send the purchase order to the vendor to give them their full purchase order lead time for the item).

2. Sales order line futures messages.

You might not want to make a rod for your own back – but go ahead and show those nice folk in Customer Services how they can see these messages (and make your life a misery).

3. Action advance messages on purchase orders.

For the buyers.

4. Futures messages on production orders.

For the planners.

5. Other action messages.

Before you set yourself the task of processing hundreds of action messages, take a look at the coverage group setup and make sure that you have the system setup so that it only gives you useful action messages:


You probably don’t need to set Action messages out for your full coverage lead time. You won’t want messages telling you to Postpone orders by just a couple of days; and you might not even want to Increase existing orders at all – just raise new orders. Setting Action (And Futures) message takes time, and the master plan session log records the time spent. Master planning > Setup > Plans > Session log > Statistics tab:


If you’re worried about the time taken to run master planning check that the system isn’t spending time raising messages that no-one reads.

Have you noticed that I’ve not mentioned Futures messages on purchase orders yet? Well, you only get those when the requested delivery date or confirmed delivery date on your purchase order line is in the past:


You won’t ever find yourself in that position will you? But maybe these are the most important messages of all, because with overdue purchase orders in your system you aren’t going to get correct planning in the first place.