Push Notifications: To Configure Push Notifications
This activity will walk you through the process of configuring MYOB Acumatica to send push notifications to an HTTP address.
Story
The business intelligence (BI) application of the MyStore company needs to display up-to-date information about item availability in warehouses. You will configure MYOB Acumatica to track the changes in item availability and to send notifications to an HTTP address when the availability of any item changes. (The processing of these notifications in the BI application is outside of the scope of this activity.)
Process Overview
You will configure MYOB Acumatica to monitor changes in the Item Availability Data (INGI0002) custom generic inquiry, which has been configured for this activity. You will then test how MYOB Acumatica sends push notifications about the changes to an HTTP address in JSON format.
System Preparation
Before you begin performing the steps of this activity, deploy an instance of MYOB Acumatica with the MyStoreInstance name and a tenant that has the MyStore name and contains the T100 data.
Step 1: Obtaining an HTTP Address for Push Notifications
- Open https://webhook.site/.
- In the Your unique URL section, copy the HTTP address
that the site has generated. An example of the address is shown in the
following screenshot.
Figure 1. An HTTP address
Step 2: Configuring Push Notifications
- In the Summary area of the Push Notifications
(SM302000) form, specify the following settings:
- Destination Name:
MyBIIntegration.
You can specify any name for the target notification destination.
- Destination Type: Webhook.
With Webhook selected, MYOB Acumatica will send HTTP
POST
requests with notification information to an HTTP address. - Address: The address that you have created in Step 1.
- Destination Name:
MyBIIntegration.
- On the Generic Inquiries tab, click Add Row on the toolbar of the Inquiries table.
- In the added row, do the following:
- In the Inquiry Title column of the added row, select Item Availability Data.
- Select the Track All Fields check box.Attention:If all fields in the results of the data query are tracked, the system produces push notifications for changes of any field in the results of the data query, which can cause the push notification queue to overflow. If you need to track only particular fields in the results of the data query, push notifications for changes in other fields are useless for you but consume system resources. Therefore, in this case, we recommend that you specify particular fields to be tracked in the Fields table.
- On the form toolbar, click Save. The following
screenshot shows the final configuration.
Figure 2. Push notification configuration
Step 3: Testing Push Notifications
- On the Sales Orders (SO301000) form, create
a sales order as follows:
- In the Customer box, select C000000001.
- Click Remove Hold.
- On the table toolbar of the Details tab, click Add Items. In the dialog box that opens, select the unlabeled check box for the AALEGO500 inventory item, and click Add & Close.
- On the form toolbar, click Save.
- On the https://webhook.site/
site, review the push notification that MYOB Acumatica sent for the change in the available quantity for the AALEGO500
inventory item. When you created a sales order, the available quantity of
the AALEGO500 inventory item was changed. The notification contains
the information about the new value of the QtyAvailable
field of the changed record in the
Inserted
element and the information about the previous value of this field in theDeleted
element. An example of the notification is shown in the following code.{ "Inserted": [ { "Warehouse":"MAIN ", "InventoryID":"AALEGO500", "Description":"Lego, 500 piece set", "QtyOnHand":1999, "QtyAvailable":1974 } ], "Deleted": [ { "Warehouse":"MAIN", "InventoryID":"AALEGO500 ", "Description":"Lego, 500 piece set", "QtyOnHand":1999, "QtyAvailable":1975 } ], "Query":"Item Availability Data", "CompanyId":"MyStore", "Id":"06284bdf-2952-4a9a-bf60-2ad0cd33924e", "TimeStamp":638465233453014192, "AdditionalInfo": { "PXPerformanceInfoStartTime":"03/20/2024 09:22:24" } }