Auto Print Script

Hi,

Does anyone have a script for Sales Order Acknowledgement? I’ve tried the Data Directive method with AutoPrint but I keep getting this error.

So I’m opting out for a script

Kind regards,
Aaron.

How we did it was setup a routing rule for the report. Using a standard break on ordernum and a condition to check the validity of the Orderhed.notifyemail address.

When then did an autoprint data directive on the orderhed table, checking the orderhed.autoprintready false to true.

We used the following Auto print Options and parameters
image

image

We have a printer setup in the system as PDF printer which points to an instance of a PDF printer on the server.

One other thing we do on the OrderHed.masterupdate method we populate the OrderHed.NotifyEmail from the SoldToContactEmail address. As I understand it the NotifyEmail is supposed to be populated from Demand Management, but we are not using it now, but at the time made sense to populate
and use it this way.

Hope that helps.

We are using immediate, but I’m sure we could use queued.

1 Like

HI Hally,

That didn’t fix our problem, I’m now getting a different error.

Kind regards,
Aaron.

@aarong,
First, don’t give up on the Auto Print Data Directive, it works quite well, it’s just tricky to get things setup as there are many interdependencies. I would argue that using the AutoPrint is easier than a script and will be more resilient during upgrades.
@Hally has provided some very good guidance.
BTW there is a Step By Step Course on your server called 'Auto Print, for EXACTLY what you are trying to do Auto Print the Sales Order Ack.
The First error looks like something isn’t setup in your Auto Print, which @Hally addressed.
The Second error looks like there is something wrong with your SSRS Report Query or the DataSet it’s trying to access is not available. If you are doing this in your Test Env, the DataSet the process is generating and what your SSRS Report Query is trying to use may not match. This is common when the Live DB is backed up and restored to the Test DB, everyone forgets about the SSRS Reports. So your Custom SSRS Report RDL may exist in your Test DB SSRS DB but it’s not configured the same.
What happens when you run this Report as Print Preview? If it works, then you are missing a report parameter or something.

So if you the order ack manually what do you get? Have you changed your RDD or RDL? It appears the dataset in you RDL has something wrong in the query. Not in front of a computer to confirm if the jobprod is part of the RDL or RDD

1 Like