Hello GP Community!

This article compile solutions to common problems relating to workflow notifications. I will mostly cover workflow notification email topic, but may be touching some other workflow topic when it applies.

The first thing to determine is if the issue is Dynamics GP system related (SQL stored procedure/CLR assemblies, message template, Active Directory query related) or SMTP related.
A good way to determine if the issue is SMTP related is by using the Test E-mail (not to be mistaken with the Test E-mail Action) button in the Workflow Setup window.


SMTP Server Connectivity Related Issues

This section covers troubleshooting SMTP server connectivity relates issues, starting with steps that can be performed quickly.
If you are not receiving the test email when using the Test E-mail button in the Workflow Setup window, this is a good place to start.

  • Password Length
    Dynamics GP client all the way to 2018 R2 has a 15 character limit. Confirm the password length and if necessary shorten the length of the password to meet the 15 character constraint.

  • SMTP Authentication Type
    Make sure the correct SMTP authentication is selected in Workflow Setup.

    In most cases, it should be set to Basic Authentication which will allow you to enter a dedicated credential used to authenticate against the SMTP server. But make sure that this credential exist and is valid on your environment.

  • Server Name
    Confirm that the server name is correct and its IP address resolvable. The easiest way to this is by pinging the server name, which would allow us to check address resolution and basic connectivity.
    Note - ping test should be performed on the SQL server hosting the Dynamics GP data (see next section for explanation).

    1. Press the key combination  ⊞ Win  +  R  to open the Run dialog.

    2. Type in cmd into the Open text box and press  OK .
      This will open a new command prompt window.

      Microsoft Windows [Version xx.x.xxxxx.xxx]
      (c) 2019 Microsoft Corporation. All rights reserved.

      C:\Users\johndoe>



    3. Type in ping -4 <server name> and press the  Enter  key.

      This is an example of a ping performed on a server call mail.fabrikam.inc.

      As you can see the server name resolves to the IP address 10.96.75.2 (highlighted in yellow) and also received four reply to the ping (highlighted in green). This is a good indication of a valid server name and that it is reachable from the current server/workstation.

      Microsoft Windows [Version xx.x.xxxxx.xxx]
      (c) 2019 Microsoft Corporation. All rights reserved.

      C:\Users\johndoe>ping -4 mail.fabrikam.inc

      Pinging mail.fabrikam.inc [10.96.75.2] with 32 bytes of data:
      Reply from 10.96.75.2: bytes=32 time=60ms TTL=240
      Reply from 10.96.75.2: bytes=32 time=60ms TTL=240
      Reply from 10.96.75.2: bytes=32 time=61ms TTL=240
      Reply from 10.96.75.2: bytes=32 time=60ms TTL=240

      Ping statisctics for 10.96.75.2:
          Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
      Approximate round trip time in milli-seconds
          Minimum = 60ms, Maximum = 61ms, Average = 60ms

      C:\Users\johndoe>

      In contrary, below be the result an invalid/unresolvable address is entered. This would indicate that the server name entered is either invalid or an issue with the your network environment's network name resolution (DNS server related issue).

      Microsoft Windows [Version xx.x.xxxxx.xxx]
      (c) 2019 Microsoft Corporation. All rights reserved.

      C:\Users\johndoe>ping -4 mail.fabrikam.inc
      Ping request could not find host mail.fabrikam.inc. Please check the name and try again.

      C:\Users\johndoe>

      If you receive a result similar to the one below, indicating a 100% loss of packet (highlighted in green). It typically indicates no issue with the server name (since it still resolves the IP address), but indicates connectivity issue possibly relating to firewall.

      Microsoft Windows [Version xx.x.xxxxx.xxx]
      (c) 2019 Microsoft Corporation. All rights reserved.

      C:\Users\johndoe>ping -4 mail.fabrikam.inc

      Pinging mail.fabrikam.inc [10.96.75.2] with 32 bytes of data:
      Request timed out.
      Request timed out.
      Request timed out.
      Request timed out.

      Ping statisctics for 10.96.75.2:
          Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

      C:\Users\johndoe>


  • Server Connectivity/Firewall
    Dynamics GP utilizes stored procedures and CLR assemblies on the SQL server to transmit workflow notification emails to the SMTP server. This means all SMTP traffic is originating from the SQL server instead of the workstation/server the Dynamics GP client is installed and running from.

    If the ping test indicates that the server name's IP address is being resolved correctly but is losing 100% of the packets, there is a good chance that either the firewall on the SQL server or something on the environment is block SMTP traffic.

    The quickest way to check if the issue is due to the windows firewall (or in some case antivirus software) is to disable windows firewall and any antivirus software on the SQL server.
    Keep in mind that disabling the window firewall is a temporary solution, and should be re-enable with the proper exception on production environments.

    If connectivity issue persist with the windows firewall and antivirus software disabled, the issue possibly lies possibly with the network. Some environment blocks SMTP traffic by default; contact you're network administrator to determine if this is the case.

    You check actual connectivity to the SMTP server by using Telnet and opening a connection to the SMTP server for a more in-depth test. I typically use a program called PuTTY since Telnet client is not installed by default on modern Windows installation.

    1.  Download PuTTY onto the SQL server. Open the program once downloaded.

    2. Type the server name into the Host Name (or IP address) box, server port into the Port box (in most case, this is either 25 or 587), select Telnet for the Connection type and press  Open .

      1. See previous Server Name section if you receive a host does not exist error.
         X   
        Unable to open connection to
        mail.fabrikam.inc
        Host does not exist

      2. Traffic to SMTP server is being blocked if you receive a connection timed out error. Note that the error may not appear for couple of minutes, as it attempts to connect within the timeout period.
         X   
        Network error: Connection timed out

      3. A new window will open similar to the one below if connection was successful.
         
        220 mail.fabrikam.inc Microsoft ESMTP MAIL Service ready at Tue, 1 Jan 00:00:00 +0000


  • SSL/TLS Encryption
    This server requires a secure connection (SSL) should be checked if the SMTP server supports/requires SSL/TLS encryption.

    Typically, servers that utilizes port 587 requires SSL/TLS encryption, however this not always the case. There are server that does support SSL/TLS encryption on port 25 and servers that allows non SSL/TLS encrypted connection on port 587.

    For example Microsoft's Office 365 SMTP server support (and highly advise) enabling SSL/TLS encryption regardless if using port 25 or 587.

    You can use the same utility, PuTTY, from the previous Server Connectivity/Firewall section to determine SSL/TLS encryption support if no other resource is available.

    1. Download PuTTY onto the SQL server. Open the program once downloaded.

    2. Type the server name into the Host Name (or IP address) box, server port into the Port box (in most case, this is either 25 or 587), select Telnet for the Connection type and press  Open .
      A new window will open similar to the one below if connection was successful.
       
      220 mail.fabrikam.inc Microsoft ESMTP MAIL Service ready at Tue, 1 Jan 00:00:00 +0000


    3. Press the  Enter  key. You may receive an error message similar to the one below; this is safe to ignore.

      220 mail.fabrikam.inc Microsoft ESMTP MAIL Service ready at Tue, 1 Jan 00:00:00 +0000

      500 5.3.3 Unrecognized command '????' [mail.fabrikam.inc]


    4. Type in EHLO localhost and press the  Enter  key.
      You should receive a reply similar to the one below.

      The AUTH PLAIN LOGIN (highlighted in yellow) indicates that the server allow connection that are not SSL/TLS encrypted.
      The STARTTLS (highlighted in green) indicates that the server supports SSL/TLS encrypted connection.

      220 mail.fabrikam.inc Microsoft ESMTP MAIL Service ready at Tue, 1 Jan 00:00:00 +0000

      500 5.3.3 Unrecognized command '????' [mail.fabrikam.inc]
      EHLO localhost
      250-mail.fabrikam.inc Hello [10.95.75.120]
      250-SIZE 157286400
      250-PIPELINING
      250-DSN
      250-ENHANCEDSTATUSCODES
      250-AUTH PLAIN LOGIN
      250-STARTTLS
      250-8BITMIME
      250-BINARYMIME
      250-CHUNKING
      250-SMTPUTF8


  • Network Related/Misc. Issue
    If none of the steps above resolve the issue, you can use a test SMTP server tool (my personal preference is a tool called Papercut) to log what may be happening behind the curtain.
    1. Download Papercut onto the SQL server. Open the program once download.

    2. Click on the  Rules  on the top-right hand of the program window, which will open the Rules Configuration window.

    3. Click on the  Add Rule  →  Relay . Change the RelayRule based on the information below.

      • Settings
        • SMTP Password: Enter the SMTP credential password for your SMTP server in this field.
        • SMTP Port: Enter the SMTP port for your SMTP server in this field. Typically, this would be either 25 or 587.
        • SMTP Server: Enter the SMTP server name of your SMTP server in this field.
        • SMTP Use SSL: Check this box if your SMTP server supports or requires SSL/TLS encryption.
        • SMTP Username: Enter the SMTP credential username for your SMTP server in this field.

      • State
        • Is Enabled: Check this box.

    4. Close the Rules Configuration window.

    5. On Dynamics GP client, navigate the menu and click on  Microsoft Dynamics GP  →  Tools  →  Setup  →  System  →  Workflow Setup  to open the Workflow Setup window.

    6. Change the settings based on the information below:

      • Server Name: change this to localhost. This will route all SMTP transmission to Papercut.

      • Port: change this to 25.

      • This server requires a secure connection (SSL): Unchecked.

      • SMTP Authentication: Change this to Anonymous Authentication.


    7.  Click  OK  to save the changes.

    8. You can use the Test E-Mail button in the Workflow Setup window or send a test workflow through the system.
      As you do this, a copy of the email should appear in the Papercut window. Papercut will also attempt to relay this email to you SMTP server and you can see the log by clickiung on the  Log  on the top-right hand of the program window.

      If the email appears in the Papercut window but is not received by the intended recipient, it points to an issue outside of Dynamics GP - see the misc section for troubleshooting steps.
      However if the email does not appear in the Papercut window - see the Email Message Related Issues below.

      The log should be able to tell you of any issue with credentials or even network timeout issue.


Email Message Related Issues

This section covers troubleshooting recipient relates issues, starting with steps that can be performed quickly.
If you are receiving the test email when using the Test E-mail button in the Workflow Setup window but are not receiving the notification email, this is a good place to start.

  • Email Message Type
    In some case the email message type for the message template utilized for generating workflow notification email is set to the wrong value on the SY04901 table.

    To check current values on the SY04901 table, run the following query.

    SELECT Email_Message_Type, * FROM SY04901

    In most cases all canned message templates should have an email message type of 2, except for WF ACTION COMPLETE* which should have an email message type of 3.

  • Recipient Email Address
    The recipient email address is retrieve from the user's Active Directory profile. In most environment that has Microsoft Exchange integration, the email address value for a user is populated automatically.
    However, in some cases the email address property for a user may not be populated.

    You will need access to the Domain Controller or a workstation with the Active Directory Users and Computers management tool.

    To check for the recipient email address, follow the step below:

    1. Open Active Directory Users and Computer.

    2. Navigate through the organizational unit (OUs) and find the recipient user. Right-click the user and select Properties.

    3. The user property should open with the General tab selected. The E-mail property is located towards the bottom of the window.
      Make sure that the value in the E-mail field has the correct email address.


  • Spam Filtering
    Check for any spam filter at the email client, server and network firewall level.

Miscellaneous Issues

This section covers all other troubleshooting steps.

  • Workflow Condition
    If the test email is working correctly and still notification email is not being sent correctly after all troubleshooting, another possible cause may be the workflow condition itself. Specially the table joins in the workflow condition.

    Even if the workflow step has not condition the table joins would still affect the notification email, since it is used to fill in the email templates.

    1. Open DEX.INI and add the following line (If the line already exists, make sure to change the value to TRUE).

      QueryDesignerAllFunctionality=TRUE

    2. Open the Dynamics GP client and navigate to the Workflow Management window.

    3. Navigate to the workflow step in question. If the step is set to Action is always required for this step, change it to Action is required only when the following condition is met temporarily to get access to the Workflow Condition Editor window.

    4. Open the Workflow Condition Editor window and click the Run Query button.

      This will run the query executed by workflow; since the window limits the number or results returned in this window, copy the query from the T-SQL field and execute it from SQL Server Management Studio for the full result.

      If the result returned does not include the workflow item submitted, it indicated and issue withe the workflow condition/table joins.