Using Print Management To Route Dynamics AX Forms

By in Dynamics AX on Sunday, April 28th, 2013

The Print Management feature within Dynamics AX does a lot more than just allow you to print reports. It also allows you to e-mail reports, automatically print and distribute forms, and also have custom form versions by customer & vendor.

In this walkthrough we will show some of the different options available to you and also how to configure them within Dynamics AX. You will learn how to:

  1. Send a Form via Email
  2. Automatically Email A Form
  3. Set Email defaults by Customer
  4. Use the Batch Server to Automatically Generate Forms
  5. Creating Alternate Form Versions

Sending a Form via Email

Forms don’t have to always be printed. You can also email them directly from the Dynamics AX client through the print management options without any additional configuration.

In this example we will show how you can send any report or form to your e-mail client.

How to do it…

To send a form via e-mail, follow these steps:

  • Find your form that you would like to email, and open up the Print Management dialog box as you would normally do.
  • Click on the Printer setup button, and select the version of the report that you want to email.
  • When the Print destination settings dialog box shows up, change the destination to E-mail.
  • This will change the options for the printing, and allow you to specify To & CC email addresses, and also the e-mail subject.
  • Also the File format field allows you to choose the attachment format for the report.
  • After changing the e-mail options, click on the OK button to update your selection, and then click OK on the Printer setup form to email your form.
  1. How it works…

  2. Dynamics AX should send you a note that your e-mail has been sent. The manual e-mail option will use your local email client to send the form, and the form will be attached to the e-mail itself.
  3. Automatically Emailing A Form Via SMTP

    The Print Management feature also allows you to configure the default print options for your documents and forms so that you don’t have to override the default print settings each time you print a form. You can use this to configure default printer settings, and also to set your forms to automatically email.

    In this example we will show how you can use the Form Settings to configure forms to automatically email.

    Before You Start…

    Before we start on the form configuration, there is one configuration step that you need to perform, which is the definition of a default SMTP Server that the forms will be sent through. This option bypasses the use of the default mail client as the mail transport which makes it a lot more flexible.

  • To do this, open up the Email parameters form from the System folder of the Setup group within the System administration area page.
  • Within the E-mail parameters form, make sure that you have an Outgoing Mail server defined.

How to do it…

To configure a form to be sent via SMTP, follow these steps:

  • Open up the Form setup menu item from the Forms folder of the Setup group within the associated area page. In this example we are updating the Order Confirmation form, so we are accessing the form defaults from the Accounts receivable area page.
  • From within the General section, click on the Print management button.
  • When the Print management form opens, find the form that you want to configure and expand its grouping node. You will see all of the different form variations which you can select and in the details panel you will see the default print management options.
  • Click on the arrow head to the right of the Destination field, and select the Printer setup sub menu item to override the default settings.
  • This will open up the default Print destination settings and we can change the default option from Printer to Email, and update the default email settings for the form.
  • When you have finished updating the defaults, click on the OK button.
  • Now the defaults for the forms print management options will show that you are emailing the form.
  1. How it works…

  2. To use the default settings, just check the Use print management destination box on the Printer setup form.
  3. Setting Print Management defaults by Customer

    For some forms and reports, you may want to have different configurations depending on who the form is associated with. In the case of the Order Confirmation, you probably the confirmation to be sent to the customer’s individual email accounts rather than the global one configured in the form defaults.

    In this example we will show how to set up form management defaults by customer.

    How to do it…

    To set print management defaults by customer, follow these steps:

  • Open up the All customers menu item from within the Customers folder of the Common group within the Accounts receivable area page.
  • Select the customer that you want to override the default organization configuration for and from the General ribbon bar group, select the Print management menu button.
  • Now within the Print management setup form you will have a new group of form configurations that you can change that are specific to that particular customer. Right-mouse-click on the form that you want to change, and from the context menu, select the Override option.
  • This will allow you to edit the default settings for that form for the customer that you selected.
  • Click on the arrow head to the right of the Destination field and select the Printer setup menu option.
  • Now change the default printer options to specify the customers email address, and also the default subject for the email.
  • When finished, click on the OK button to save your changes.
  • Now the customer defaults for the forms print management options will show that you are emailing the form.
  1. How it works…

  2. To use the default settings, just check the Use print management destination box on the Printer setup form.
  3. Using the Batch Server to Automatically Generate Forms

    For a lot of forms, you may want to configure them to automatically run without you having to kick off the process every time. You can do this simply by creating a batch job for the form, and once it is set, then Dynamics AX will do all of the work for you.

    In this example we will show how you can configure batch jobs for your reports and forms.

    Before You Start…

    In order to submit your forms and reports to a batch server, you need to make sure that you have one configured. To do this, follow these steps:

  • Open the Batch groups menu item from the Setup group within the System administration area page.
  • Click on the New button in the menu bar.
  • Give your new batch group a Group ID and also a Description.
  • Click on the Batch servers tab, and select the servers that you want to run the batch processes on from the Remaining servers list box and click on the < button.
  • Now that the Batch group is defined, click on the Close button.

How to do it…

To use the batch server to automatically generate forms, follow these steps:

  • In all of the print dialog boxes, there is a Batch button in the bottom right. Selected the defaults that you want to use when the batch job is submitted, and click it.
  • When the Batch processing dialog box is displayed, select the default Batch group that you want to perform the print job on. Also, Make sure that you check the Batch processing check box.
  • To configure when and how often the batch job is ran, click on the Recurrence button.
  • In the Recurrence form, you can configure how many times you want to run this batch job, which days, and also how often. After you have finished click on the OK button.
  • Click on the OK button on the Batch processing form to save your batch job.
  • This will open up the alerts options, where you can specify if when and how you want to be notified that the jobs have been completed.
  • After you have selected your notification preferences, click the OK button, and you are done.
  1. How it works…

  2. If you want to see all of the batch jobs that you have configured within Dynamics AX, in order to maintain them, click on the Batch jobs menu item in the Batch jobs folder of the Inquiries group of the System administration area page. This will show you all of the active batch jobs.
  3. Creating Alternate Form Versions

    If you want to look even cleverer with what you are doing with forms, and don’t mind getting your hands a little dirty through development, then you may want to create custom variations of forms that can be selected from within the Print Management configuration. In order to do this though you do need to have a copy of Visual Studio, and update the code in AOT, but don’t be too concerned, you are not doing anything that is too hard.

    In this example we will show how you can create a new template form that will be available within the Print Management.

    How to do it…

    To create alternate form versions, follow these steps:

  • Open up Visual Studio, and select the Application Explorer browser.
  • From the File menu select the New Project menu item.
  • When the template browser opens, select the Report Model project template, and give your project a more appropriate name.
  • Expand the SSRS Reports group, and find the report that you want to create a new template version for. In this case we are selecting the default report for the Sales Confirmation which is SalesConfirm.
  • Select one of the original reports that are in the Designs group, and make a copy.
  • Rename your new report to something a little more appropriate.
  • If you double click on your new design, then you will be taken directly into the SSRS report designer, where you can make any changes that you want to the report.
  • When you are happy with the changes that you have made to the report, return to the Solution Explorer, right-mouse-click on the project, and select the Add to AOT menu item.
  • Now when you open up AOT, if you look within the SSRS Reports group you will see your new report option. To publish the report definition to the Reporting Services server, right-mouse-click on the SSRS Report within AOT, and select the Deploy Element menu item.
  • There is one final step that is required, and that is to register the new report format as a valid option within the Print Management dialog box. To do this, find the PrintMgmtReportFormat table within the Data Dictionary Tables, expand out the methods, and open up the populate method.
  • Within the code, find the area where your forms are being registered, and add a new addOther entry that references your new form.
  • After adding the registration entry, save your changes.
  1. How it works…

  2. Now when you open up the Print management setup form, within the Report format drop down, you will be able to select your new report format that you have just created.
  3. Summary

  4. The print management feature within Dynamics AX is a simple way to set up your reports and forms to be automatically distributed, without having to purchase other 3rd party add-ons. In addition to the examples that we showed in this walkthrough, you should also consider:
  • Setting up automatic distribution lists for recurring company reports, and having them queued to print through the batch servers.
  • Emailing to in-house fax servers to send faxes to the handful of people that still require them.
  • Routing reports to different printers based on conditions.

Leave a Reply

*
*