How to get a notification if an X3 user deletes a sales order

2 minute read time.

In this blog, I will show you how to setup a notification alert that will send an email any time an X3 user deletes a sales order. We will create the context for the email being sent and add a simple condition. In the end, we will have an email sent anytime a sales order is deleted from X3, with an amount greater than $2000.00.  In the email we will include, the sales order number, amount, and the user who deleted the order. 

Create the Notification

Go to Setup, Workflow, Notifications and click the New button to create a new Notification.

Let's create one as follows; Workflow code=ZWFN_Test, Description=Workflow notification for deleted sales orders greater than 2000.  Check the Active checkbox.  Set the Event type=Object, Code= SOH, and place a checkmark next to Deletion checkbox. 

The condition in our example will be sales orders greater than $2000.00.  In the Expression box, we want to create that condition and to do that you can either enter ORDINVATI > 2000, or click the Action menu for the Expression box and select Formula Wizard.  Then expand, Screen SOH4 and locate ORDINVATI and click it and click OK

In the Recipients area, Type=User and in the box next to it, type in the recipients email address with quote before and after the address like this '[email protected]'.  Place a checkmark next to the Send mail checkbox. (Note ** One limitation this notification has is you can only include a maximum of 2 recipients)

Move down to the Message area to enter a subject and email body context for the email that will be sent to the recipient. In the Object area, type the following (in between quotes) 'Notification warning.. sales order has been deleted'.  Then in the Text area, we would like to add the sales order number, sales order create date, user who deleted the sales order, and sales order amount. Enter the following:

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

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

<Notification ZWFN_Test>

By the way, I added the last line <Notification ZWFN_Test>  as part of the email to help you know the name of the notification that was sent out. It's not a must-have, but helpful if you have a lot of notifications being sent out checking sales orders. 

You are done.  Save the Notification and Validate it.   

Create the Condition

Next lets test the notification. Create and save a new sales order in the same folder as the notification. Make sure the sales order total is $2000 or higher!. Delete the sales order and after a few moments, you should see an email that looks like this:

If you followed these steps and did not receive an email, you will need to check your email server to make sure its running. Also, you need to have entered the email server in X3 under Setup, General Parameters, Parameter values for SUP under the SEED folder.  This part of the setup was not covered in this blog.