How to create a workflow that will email an invoice to a customer?

Sage X3 Business Cloud has a number of add-ons that you can take advantage of to streamline emailing your documents to your customers, such as EDD, EDM, PIA, but in standard X3, a workflow can be setup to email a single document like a Sales order invoice to a customer in an automatic way, by following the steps below.

Now before you go about any of these steps, make sure you have proper backups in place that you can roll back to

Email settings in place?

Without proper workflow email validation links in place this post will not work. So first let’s go about making sure you are the right links in place before moving further.

When setting the worklfows for Sales Order and Purchase orders, the system generates two links sent on an e-mail so the Signing User can Approve or Reject the Sales order and/or Purchase Order. If this is not working its an indicator that proper links are not in place.

  1. Make sure that the X3 Web Services are installed on the SAFE X3 management Console.
  1. Log on your Sage X3 Server.
  2. Open the SAFE X3 System Management Console.
  3. Select the WEB Servers option
  4. Check if there is a Web Server configured.
  5. Take note of the Port used to connect to the Web Server. This will be used in the configuration steps below.

2 Enter the proper parameters on your Production and/or Test Folder

  1. Go to Setup, General parameters, Parameter values.
  2. Double-click SUP Supervisor to expand it.
  4. Select the Group WRK, the right click and select DETAIL.
  5. On the parameter values window, enter the following information ( remember that the names has to coincide with the server settings on the X3 Console)
    1. Parameter SERMES : enter your e-mail server name or IP address
      • If you don’t user an e-mail server, enter RELAY.MAILINTERNAL.COM   
    2. Parameter WRKRMTDIR: [install drive]:\Sage\[SolutionName]\FOLDER\[foldername]
      • Example: E:\SAGE\SAGEX3V7\FOLDERS\SEED   
    3. Parameter WRKRMTHTTP: <<SERVERNAME>>:<<PORT CONFIGURATION>>/sdata/x3/erp/<<FOLDER>>/$service
      • For example: localhost:8124/sdata/x3/erp/<<FOLDER>>/$service
      • Legacy parameter. Leave blank in v7 and above
      • For example: Same server name as above (not including http://) and the port shown in X3 Solution’s Main Processor section.
      • For example: Same server name and port as above (not including http://). Note: This IP address must be able to be “seen” externally from your domain.
      • For example: Same server name and port as above (not including http://).
  6. Click OK to close the page.
  7. Click SAVE to save the changes.

Workflow setup

Now that you have the appropriate email settings in place. Setup a workflow based on the APRINT workflow, but to print a specific report.

  1. Open Setup, General parameters, Parameter values.
  2. Expand SUP chapter and click on Action button for the WRK Group.
  3. Verify that you have an email server entered for parameter SERMES.
  4. Click OK.
  5. Click on Action button for RPT Group.
  6. Verify that ASAIDEST parameter is set to No.
  7. Open Setup, Workflow, Workflow rules.
  8. Select APRINT workflow.
  9. Create a new workflow by changing APRINT name to a new name.
  10. Set the condition on the header to only run when using your report, for example, 


  • Note: You may also want to either deactivate APRINT or add [F:ARP]RPTCOD<>”SBONFAC” so that only one workflow is triggered. Also, double check that you did not make a typo. Typos will result in no error messages being displayed to warn you. Emails will simply not generate.
  1. On the Recipients tab, select [F:SIH]BPR as the recipient and the appropriate function.
    • Note: Again, double check that you did not make a typo.


  1. On the Message tab, verify that GFILPATH is set under attached documents.
  2. Click Save and Validate.
  3. Open Common Data, Customers, Customers.
  4. Select the customer you like to email.
  5. Click on Contacts tab and select the contact you like the email to go to and set them to the same function as the workflow function( in this example, Buyer).
  6. Open Sales, Invoices, Invoices.
  7. Create a new invoice for the customer above.
  8. Click Print to print the invoice.
  9. Select SBONFAC report( this is the report we set as part of the workflow)
  10. Choose output of Message.
            Note: You may also create destination that defaults to Message.
  11. Click Print. If everything was set up properly, you should receive a popup box showing you which email will be sent the attachment. Click OK.
    • Note: If you do not receive this popup box, you either made a typo in one of the above sections, or you did not set up your email settings correctly. See linked article 56835, titled,”HTG – How to properly setup workflow email validation links to work.”
  12. Your customer will receive an email with the attached invoice.

Important Points


  • The link which is generated is based upon the link used by the user signing into X3. For example: If the user logs in via http://localhost:8124, this will be part of the signature link. Localhost is not resolvable outside the domain.
  • You must print from the actual invoice (Print>Record) to pull the email from the recipient.
  • The workflow will only generate one file and one email. It will choose the last email it finds if it finds multiple.
  • To know if the email is successful either add yourself as a Copy recipient or mark the Debug mode check box on the General tab of the workflow rule to receive a trace file.
  • You cannot customize the name of the attached .pdf file without modification to the code.
  • If you’ve set an SSL / HTTPS external website as the entry point to X3, the parameters need to have its address as the server.

    (This solution is for v7+)


    Description Value
    AWRKSYRA Syracuse server[foldername]
    WRKRMTDIR Workflow links directory <same as above>
    WRKRMTHTTP Workflow links HTTP address[foldername]/$service
    WRKRMTMAC Serverworkstaton workflow II <not used in v7+>
    WRKSINTER Internet workflow feedback
    WRKSINTRA Intranet workflow feedback