Automated Synchronization: To Activate a Predefined Business Event
The following activity will walk you through the process of configuring a business event that sends an email notification to the store administrator when the synchronization of an order placed in the e-commerce system is aborted.
Story
Suppose that you have configured the automated import of sales orders from the e-commerce store and want Jerald Stevens, an e-commerce manager of SweetLife, to be notified when the system has failed to process a synchronization record of a sales order too many times (based on the setting specified in the system) and has set its status to Aborted, which excludes the record from synchronization. To make the system send a notification to the e-commerce manager, Jerald Stevens, every time the synchronization of a sales order is aborted, you need to activate a predefined business event that will trigger the sending of an email message to the store administrator every time the status of a synchronization record of a sales order changes to Aborted.
Configuration Overview
In the U100 dataset, the following tasks have been performed for the purposes of this activity:
- On the Email Templates (SM204003) form, the Aborted Synchronization Record notification template has been defined.
- On the Users (SM201010) form, the stevens user record has been created.
Process Overview
You will do the following:
- On the Shopify Stores (BC201010) form, specify the store administrator who should receive email notifications about aborted synchronization records.
- On the Business Events (SM302050) form, activate the predefined business event that will trigger the sending of an email when the system fails to process a sales order synchronization record more than the maximum number of synchronization attempts allowed.
- On the Email Templates (SM204003) form, review the notification template that is used for notifications about aborted sales orders.
System Preparation
Before you perform the instructions of this activity, do the following:
- Make sure that the following prerequisites have been met:
- The Shopify store has been created and configured, as described in Initial Configuration: To Set Up a Shopify Store.
- The connection to the Shopify store has been established and the initial configuration has been performed, as described in Initial Configuration: To Configure the Store Connection.
- Sign in to an MYOB Acumatica instance with the U100 dataset preloaded. You should sign in by using
the following credentials:
- Username: gibbs
- Password: 123
- Sign in to the admin area of the Shopify store as the store administrator in the same browser.
Step 1: Specifying the Store Administrator
To specify the administrator of the SweetStore - SP store, do the following:
- On the Shopify Stores (BC201010) form, select the SweetStore - SP store.
- On the Connection Settings tab, in the
Administrator box (the Store Administrator
Details section), select stevens.
The user you select in this box will become the recipient of email notifications sent by the business event that you will activate in the next step.
- On the form toolbar, click Save.
Step 2: Activating the Business Event
To activate the business event that will trigger the sending of email notifications to the store administrator, do the following:
- On the Business Events (SM302050) form, select the BCAbortedOrder event.
In the Summary area, notice that the Screen Name is set to BC-DB-AbortedOrders, which is the generic inquiry that collects aborted synchronization records of the Sales Order entity for all stores in MYOB Acumatica for which the administrator has been specified.
Also in this area, notice that Raise Event is set to For Each Record; on the Trigger Condition tab, notice that the operation of the only condition in the table is Record Inserted. With these settings, a business event will be raised for each synchronization record that is added to the results of the generic inquiry.
On the Subscribers tab, the only subscriber to this business event is Email Notification (the Type column), which indicates that an email is sent whenever the business event is raised. In the Subscriber ID column, which holds the ID of the notification template for an email notification, Aborted Order Notification is selected. In the next step, you will review the template used for the email notifications.
- In the Summary area, select the Active check box.
- On the form toolbar, click Save.
You have activated the business event that will trigger sending Jerald Stevens an email notification every time a synchronization record of the Sales Order entity is assigned the Aborted status.
Step 3: Reviewing the Notification Template
To review the template for notifications about aborted sales order synchronization records sent to the store administrator, do the following:
- While you are still viewing the BCAbortedOrder business event on the Business Events (SM302050) form, on the Subscribers tab, click the Aborted Order Notification link in the Subscriber ID column.
- On the Email Templates (SM204003) form, which opens in a new tab, review the details of the template.
In the To box, notice that instead of a specific user name or email address, a variable is used. So emails are sent to whoever is specified as the administrator of the store to which the aborted synchronization record belongs.
On the Message tab, review the details of the aborted synchronization record. The information includes the store name, the entity type, the local and external identifiers of the record, the last operation, and the last error. The email body also contains the link to the Sync History (BC301000) form, on which you can review the status of all synchronization records and resynchronize them after the issues are resolved.
In this activity, you have activated the predefined business event that will trigger the sending of an email to the store administrator about aborted synchronization of sales orders.