Notification using Workflow rules

3 minute read time.

In my previous blog, "How to get a notification if an X3 user deletes a sales order", I showed how to setup a Workflow notification email to be sent when a sales order whose values is greater than $2000 is deleted by an X3 user.  In this blog I will explain how to setup a notification email using a Workflow Rule. By the time we are done, we will create a condition to send a notification email anytime a sales order is created whose dollar amount is $2000 or greater. 

Create the Workflow rule

The setup for Workflow rules begins in Setup, Workflow, Workflow rules.  Then, click on New to create new workflow code.  Let's make the Code = ZWF_SOC, the Description =  "Workflow SO create gr 2000",  the Category = SAL.  and don’t forget the Active checkbox

Next in the General section, set the Event Type=Object, Event Code= SOH, and the Operation = C.  (Note, for the Operation, you can either type in a C, or use the lookup to locate and select the Create option)

Next, in the Recipient section, select Type=User, Recipient =’[email protected]’, (the email address in between quotes), Send Mail = Yes.   By the way, when creating a workflow rule, you are able to add more than two recipients.  The Workflow notification only allowed for two recipients. So, if you need more than two, creating this rule is the way to go. 

The condition in this case will be a sales order with a value greater than $2000.  To create this condition, go to the Conditions section. 

Set Type=Header, Conditions = [M:SOH4]ORDINVATI > 2000  You can either type this in or use the Formula wizard to build it for you. (You would need to select the Formula Wizard and locate the ORDINVATI field from the list and click the OK button).   Click on checkboxes next to Trigger Mail

Let's define the notification email that will be sent out, when the condition of creating a sales order with an amount greater than $2000 is created.   The Object textbox is the subject line of the email.  Enter something meaningful like 'Sales Order over $2000 has been created'.  The Text area defines what the body of the email will say.  You can use the Formula Wizard as before to locate and include many different variables and values.  You can also look at some of the example Workflow rules in the SEED folder.  I kept it simple and wanted to include, the sales order number that was created, when it was created, which X3 user created it, and the amount of the sales order.  Here is what I entered in the Text area:

 

Sales Order | [F:SOH]SOHNUM | created on |CREDAT| has been created by user: |GUSER|

Sales Order Amount-> | [F:SOH]ORDINVATI |

Notification-> ZWF_SOC

(Note I added the Notification-> ZWF_SOC to help identify the name of the notification. If you have many notification and workflow rules, it will be helpful to know which one is which when troubleshooting. 

Finally, click Save and then click Validation. You have now completed the setup for the Workflow rule notification email. 

Create a sales order to trigger the notification

Now, create a new sales order with a total value greater than $2000.  To make it easier, you can pull up and existing order, blank out the sales order number and tab off the field. Then make any necessary changes to the items and/or quantities to bring the total up to $2000.  Click Save to save the order.  After a few moments, you will see an email such as:

There will be a setup of your email server required in order to receive workflow notification emails. This setup was not covered in this blog.  So, if you did not a notification email, check the email server first. In the next blog, I will talk about a couple of areas to check when troubleshooting the Workflow Rules notification emails.