How to Email and Print specific Sales Invoice Reports to different Customers using DRM

Subject:The steps here describe how to set up Dynamics Report Manager (DRM) to email and print specific Sales Invoice reports to different customers.

Resolution:
Here are the steps on how to set up the 3 Reports, 3 Batch Reports, and 1 Launch Point in DRM.

Customer Setup:

In this example, we are using two Sales Invoice Reports and there are three customers with different needs. Customer AARONFIT0001 needs Invoice 1 emailed, Customer ADAMPARK0001 needs Invoice 2 emailed, and Customer BERRYMED0001 needs Invoice 1 printed. In the Customer Maintenance window, the customers have the following values entered (see screenshots below).

Customer AARONFIT0001
User Defined 1: 1
Comment 2: Email
Customer ADAMPARK0001
User Defined 1: 2
Comment 2: Email
Customer BERRYMED0001
User Defined 1: 1
Comment 2: Print

Note: If a Customer needs both an email and a printed copy of the Invoice, you can change the Where clause in the Data tab of the Batch Report as appropriate.

Adding a Report to email the report:

  1. Go to Reports | Dynamics Report Manager | Dynamics Report Manager Explorer.
  2. In the Dynamics Report Manager Explorer window, click the Reports tab, and then click the Add Report button.
  3. In the Add Report window, mark Enter Manually, select the Report Type of Crystal Report, and then click OK.
  4. In the Report Maintenance window:
    1. Click the Technical Name Folder button to browse to the location of your report and select it.
    2. Enter a Display Name for the report.
    3. Click the Parameters tab.
      1. Click the Add Parameters button.
      2. Click Import and then click Import again to add the parameters currently on the Crystal Report.
      3. Or, you can click Manual to manually add a parameter to the report.
    4. Click the Destination tab.
      1. Select File for Destination.
      2. To modify the name of the file, click the Output File Path and Name Builder button.
      3. In the Output Filename Builder window, place your cursor in front or after Report. Note: You can delete Report in the Filename or keep it.
      4. In the Insert Tokens section, select which Tokens you would like to add to the name of the file. After you add a Token, move your cursor in front or behind the Token to add another one.
      5. Click OK.
    5. Click Access tab and verify the appropriate access is selected.
    6. Click the Connection tab and verify the appropriate settings are selected.
    7. Click the Destination tab.
      1. Select Printer for Destination.
      2. Select the appropriate Printer Settings and Printer Orientation.
      3. Click OK.
    8. Click the Access tab and verify the appropriate access is selected.
    9. Click the Connection tab and verify the appropriate settings are selected.
    10. Click the Reports tab.
    11. Click the + button to add the Batch Report you created in Step 15b.
    12. Repeat Step 21d to add the Batch Report you created in Step 15x.
    13. Repeat Step 21d to add the Batch Report you created in Step 18b.
    14. Click the Access tab and verify the appropriate access is selected.
    15. Click the Actions tab.
    16. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Set Parameter to Field.
      2. In the Action Settings section, select the following:
        Report: Select the first report in the list.
        Parameter: Batch Number
        Product: Microsoft Dynamics GP
        Series: Sales
        Form: Sales Batch Entry
        Window: Sales Batch Entry
        Field: Batch Number
      3. Click OK.
    17. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Insert Before/After Breakpoint.
      2. Click OK.
    18. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Run Field Script.
      2. In the Action Settings section, select the following:
        Product: Microsoft Dynamics GP.
        Series: Sales
        Form: Sales Document Print Options
        Window: Sales Document Print Options
        Field: Cancel Button
      3. Click OK.
    19. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Launch Specific Report.
      2. In the Action Settings section, select the following:
        Report: Select the first report in the list.
      3. Click OK.
    20. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Set Parameter to Field.
      2. In the Action Settings section, select the following:
        Report: Select the second report in the list.
        Parameter: Batch Number
        Product: Microsoft Dynamics GP
        Series: Sales
        Form: Sales Batch Entry
        Window: Sales Batch Entry
        Field: Batch Number
      3. Click OK.
    21. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Launch Specific Report.
      2. In the Action Settings section, select the following:
        Report: Select the first report in the list.
      3. Click OK.
  5. Click Save.
  6. Repeat Steps 2 – 6 to add another Report to be emailed.
  7. Adding a Report to print the report:
  8. Go to Reports | Dynamics Report Manager | Dynamics Report Manager Explorer.
  9. In the Dynamics Report Manager Explorer window, click the Reports tab, and then click the Add Report button.
  10. In the Add Report window, mark Enter Manually, select the Report Type of Crystal Report, and then click OK.
  11. In the Report Maintenance window:
    1. Click the Technical Name Folder button to browse to the location of your report and select it.
    2. Enter a Display Name for the report.
    3. Click the Parameters tab.
      1. Click the Add Parameter button.
      2. Click Import and then click Import again to add the parameters currently on the Crystal Report.
      3. Or, you can click Manual to manually add a parameter to the report.
  12. Click Save.
  13. Repeat Steps 7-11 to add another Report to be printed.Adding a Batch Report to email the report:
  14. In the Dynamics Report Manager Explorer window, click the Reports tab, and then click the Add Report button.
  15. In the Add Report window, mark Use Wizard, and then click OK.
  16. In the Batch Report Wizard Welcome window:
    1. Click Next.
    2. Mark the checkbox in front of the Display Name you entered in step 4b above, and then click Next.
    3. Click Next.
    4. In the Search field, enter the name of the report’s main table, and then click the Binoculars button. In this example, it is the Sales Transaction Work table.
    5. Mark the Sales Transaction Work for Microsoft Dynamics GP table, and then click Next.
    6. Link the parameter(s) to a field in the main table. If a parameter is for a field in another table, click the Link Tables button to link another table. (See Steps 15i – n below for details on linking a table.)
    7. Click Next.
    8. Specify the Batch Number Filter field from the Sales Transaction Entry window, and then click Next.
    9. Click the Link Tables button.
    10. In the DRM Linked Tables window, click the Add Link button.
    11. In the DRM Tables window, select Company for Series, enter Internet for Find and click the Binoculars button, select Internet Addresses, and then click Select.
    12. In the DRM Linked Tables window, select Customer Number in the Sales Transaction Work column, select Master ID in the Internet Addresses column, and then click Link.
    13. Repeat step 15j to link another table.
    14. In the DRM Linked Tables window, click OK.
    15. In the Batch Report Wizard window, select the Internet Addresses table.
    16. Select INet1 and click the Assign table field to To address button, and then click Next.
    17. Enter a Subject and Message, and then click Next.
    18. Enter a display name in the Batch Report Description field, and then click Next.
    19. Click Next.
    20. Click Finish.
    21. In the Batch Report Maintenance window, click the Data tab. Here is an example of what you will see.SELECT
      ISNULL(b.INET1, '')[INet1],
      ISNULL(a.SOPNUMBE, '')  [SOP_Number],
      ISNULL(a.SOPTYPE, '')   [SOP_Type]
      FROM TWO..SOP10100 a
      LEFT OUTER JOIN TWO..SY01200 b
      ON (a.CUSTNMBR = b.Master_ID)
      WHERE
      ISNULL('%PARAM1%', '') = a.BACHNUMB
      *Note: TWO should be replaced with your specific Company ID.
    22. In this example, I would like to manually link the RM00101 (Customer Master) table and then add a restriction based on the Customer Maintenance window User Defined 1 field beginning with a value of 1 and Comment 2 beginning with a value of E. Here is an example of what it would look like:SELECT
      ISNULL(a.CNTCPRSN, '') [Contact_Person],
      ISNULL(b.INET1, '') [INet1],
      ISNULL(a.SOPNUMBE, '') [SOP_Number],
      ISNULL(a.SOPTYPE, '') [SOP_Type],
      ISNULL(a.BACHNUMB,'') [Batch_Number],
      ISNULL(c.USERDEF1,'') [User_Defined_1]
      FROM TWO..SOP10100 a
      LEFT OUTER JOIN TWO..SY01200 b
      ON (a.CUSTNMBR = b.Master_ID)
      LEFT OUTER JOIN TWO..RM00101 c
      ON (a.CUSTNMBR = c.CUSTNMBR)
      WHERE
      ISNULL('%PARAM1%', '') = a.BACHNUMB
      and c.USERDEF1 like '1%' and c.COMMENT2 like 'E%'
      *Note: TWO should be replaced with your specific Company ID.
    23. Click Save.
    24. Repeat Steps 13 – 15 to add another Batch Report for the next Report you created in Step 4b. Important notes:
      1. In Step 13b, choose the new Report you created in Step 4b.
      2. In Step 13v, I changed my restriction to be based on the Customer Maintenance window User Defined 1 field beginning with a value of 2.

    Adding a Batch Report to print the report:

  17. In the Dynamics Report Manager Explorer window, click the Reports tab, and then click the Add Report button.
  18. In the Add Report window, mark Use Wizard, and then click OK.
  19. In the Batch Report Wizard Welcome window:
    1. Click Next.
    2. Mark the checkbox in front of the Display Name you entered in step 10b above, and then click Next.
    3. Select No for the Do you intend to have the reports emailed? field, and then click Next.
    4. In the Search field, enter the name of the report’s main table, and then click the Binoculars button. In this example, it is the Sales Transaction Work table.
    5. Mark the Sales Transaction Work for Microsoft Dynamics GP table, and then click Next.
    6. Link the parameter(s) to a field in the main table. If a parameter is for a field in another table, click the Link Tables button to link another table. (See Steps 18i – n below for details on linking a table.)
    7. Click Next.
    8. Specify the Batch Number Filter field from the Sales Transaction Entry window, and then click Next.
    9. Click the Link Tables button.
    10. In the DRM Linked Tables window, click the Add Link button.
    11. In the DRM Tables window, select Company for Series, enter Internet for Find and click the Binoculars button, select Internet Addresses, and then click Select.
    12. In the DRM Linked Tables window, select Customer Number in the Sales Transaction Work column, select Master ID in the Internet Addresses column, and then click Link.
    13. Repeat step 18j to link another table.
    14. In the DRM Linked Tables window, click OK.
    15. In the Batch Report Wizard window, select the Internet Addresses table.
    16. Select INet1 and click the Assign table field to To address button, and then click Next.
    17. Enter a Subject and Message, and then click Next.
    18. Enter a display name in the Batch Report Description field, and then click Next.
    19. Click Next.
    20. Click Finish.
    21. In the Batch Report Maintenance window, click the Data tab. Here is an example of what you will see.SELECT
      ISNULL(b.INET1, '')   [INet1],
      ISNULL(a.SOPNUMBE, '')   [SOP_Number],
      ISNULL(a.SOPTYPE, '')   [SOP_Type]
      FROM TWO..SOP10100 a
      LEFT OUTER JOIN TWO..SY01200 b
      ON (a.CUSTNMBR = b.Master_ID)
      WHERE
      ISNULL('%PARAM1%', '') = a.BACHNUMB 
      *Note: TWO should be replaced with your specific Company ID.
    22. In this example, I would like to manually link the RM00101 (Customer Master) table and then add a restriction based on the Customer Maintenance window Comment 2 field beginning with a value of P. Here is an example of what it would look like:SELECT
      ISNULL(a.CNTCPRSN, '')   [Contact_Person],
      ISNULL(b.INET1, '')   [INet1],
      ISNULL(a.SOPNUMBE, '')   [SOP_Number],
      ISNULL(a.SOPTYPE, '')   [SOP_Type],
      ISNULL(a.BACHNUMB,'') [Batch_Numbeer],
      ISNULL(c.USERDEF1,'') [User_Defined_1]
      FROM TWO..SOP10100 a
      LEFT OUTER JOIN TWO..SY01200 b
      ON (a.CUSTNMBR = b.Master_ID)
      LEFT OUTER JOIN TWO..RM00101 c
      ON (a.CUSTNMBR = c.CUSTNMBR)
      WHERE
      ISNULL('%PARAM1%', '') = a.BACHNUMB
      and c.USERDEF1 like '1%' and c.COMMENT2 like 'P%' 
      *Note: TWO should be replaced with your specific Company ID.
    23. Click Save.
    24. Repeat Steps 16 – 18 to add another Batch Report for the new Report you created in Step 10b. Important notes:
      1. In Step 18b, choose the new Report you created in Step 10b.
      2. In Step 18v, change the restriction as appropriate.Adding a Launch Point:

     

  20. In the Dynamics Report Manager Explorer window, click the Launch Points tab, and then click the Add Launch Point button.
  21. In the Add Launch Point window, mark Enter Manually, select Window Field or Button for Launch Point Type, and then click OK.
  22. In the Launch Point Maintenance window:
    1. Enter a Name for the Launch Point.
    2. Click the Settings tab and select the following:
      Trigger Type: Window Print Menu
      Attach Type: Before and After original script
      Product: Microsoft Dynamics GP
      Series: Sales
      Form: Sales Batch Entry
      Window: Sales Batch Entry
    3. Click the Reports tab.
    4. Click the + button to add the Batch Report you created in Step 15b.
    5. Repeat Step 21d to add the Batch Report you created in Step 15x.
    6. Repeat Step 21d to add the Batch Report you created in Step 18b.
    7. Click the Access tab and verify the appropriate access is selected.
    8. Click the Actions tab.
    9. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Set Parameter to Field.
      2. In the Action Settings section, select the following:
        Report: Select the first report in the list.
        Parameter: Batch Number
        Product: Microsoft Dynamics GP
        Series: Sales
        Form: Sales Batch Entry
        Window: Sales Batch Entry
        Field: Batch Number.
      3. Click OK.
    10. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Insert Before/After Breakpoint.
      2. Click OK.
    11. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Run Field Script.
      2. In the Action Settings section, select the following:
        Product: Microsoft Dynamics GP
        Series: Sales
        Form: Sales Document Print Options
        Window: Sales Document Print Options
        Field: Cancel Button.
      3. Click OK.
    12. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Launch Specific Report.
      2. In the Action Settings section, select the following:
        Report: Select the first report in the list.
      3. Click OK.
    13. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Set Parameter to Field.
      2. In the Action Settings section, select the following:
        Report: Select the second report in the list.
        Parameter: Batch Number
        Product: Microsoft Dynamics GP
        Series: Sales
        Form: Sales Batch Entry
        Window: Sales Batch Entry
        Field: Batch Number.
      3. Click OK.
    14. Click the Add Custom Actions button.
      1. In the Custom Actions column, select Launch Specific Report.
      2. In the Action Settings section, select the following:
        Report: Select the second report in the list.
      3. Click OK.
    15. Click Save.

Related Content