Push Notifications – Implementing Custom Destination Type

Prasanna Amruthavakkula | December 28, 2018

Push Notifications - Implementing Custom Destination Type

In the normal circumstances, the user has to schedule data sync between two or more systems to update the data between those two systems. Traditionally, the process was dependent on screen based web services or end points which require a scheduled process. Even then, the real time data sync was a challenge. To address this challenge in dynamic e-commerce world, Acumatica has introduced the feature of “push notification” in its latest version.

This article details on how the new feature of “push notification” helps the user. More so, in customizing the destination type and perform real-time sync between two (or more) systems without use of scheduled web services or end points.

Purpose:

This blog post demonstrates how a user can get real time data sync using “push notification” to support custom destination types. The challenge faced by the e-commerce world is now addressed by Acumatica in its latest release version 2017 R2. The said version, interalia, has multiple unique features including configuration options such as “Webhook”, “Message Queue” and “SingalR Hiub”.

Features:

Using this new feature “push notification”, user can define new custom destination type, to configure and perform real time notification and updates to the connecting system directly. This addresses the challenge of scheduling the data sync between two systems thereby reducing the time involved and getting the data sync at the click of a mouse. This apart, push notifications also reduce the efforts of configuring the data sync using web services, end points and implementing the same in connecting systems.

Step by step process:

Push notifications “PX.PushNotifications.dll” provides interfaces which can be extended and used to define custom destination apart from using to perform real time data sync.

Custom Destination Type PX.PushNotifications.NotificationSenders.IPushNotificationSenderFactory
Transmitting notification PX.PushNotifications.NotificationSenders.IPushNotificationSender

Step 1: Add “PX.PushNotifications.dll: Reference to the class library solution.

Add “PX.PushNotifications.dll: Reference to the class library solution

Step 2 :

Add new class “CustomDestination.cs”
implementing PX.PushNotifications.NotificationSenders.IPushNotificationSenderFactory and
“CustomDestinationNotification “ implementing
PX.PushNotifications.NotificationSenders.IPushNotificationSender

Add new class “CustomDestination.cs”

Step 3 :

On “CustomDestination.cs” class provides the below details
Type: Provide Custom Destination Type with minimum 4 characters.
Type Description: Provide description about the destination type.
Create: Return CustomDestinationNotification object with address and name parameters

Adjust CustomDestination.cs

Step 4:

On “CustomDestinationNotification” class, user can customize “send” method and post notifications to any destination point.

Customize “CustomDestinationNotification” class

Step 5 :
Once the solution is built, user can access the custom destination type in notification screen.

i. Select the custom destination type
Select the custom destination type

ii. Provide destination name, address and map GI screens to which user needs notification.
Provide destination name, address and map GI screens to which user needs notification.

iii. Notification will be triggered if any of the configured GI fields are modified, which in turn will be directed to the custom destination send method (as depicted below).
Notification will be triggered if any of the configured GI fields are modified, which in turn will be directed to the custom destination send method

Solutions in case of failed messages

The custom destination type handles the exceptions in the same manner as that of a predefined destination types and uses the same push notification screen to reprocess the failed message. This feature adds value in the sense that failed messages are logged automatically and therefore, the user can review/ reprocessed.

Summary

Push notification with custom destination type is a new feature released in latest version of Acumatica released in 2017 R2. This feature provides an alternate solution to the e-commerce world for real time data sync. This feature enables the user to configure or redefine destination types by which data sync can be provided directly to the connecting system. This also includes automatic logging of failed messages enabling the user to review and reprocess. This effectively reduces the time involved in scheduling the data sync between two connecting systems. This also provides new dimensions to the real time data sync which is critical for success of a e-commerce website.

Prasanna Amruthavakkula

Software Engineer at Kensium Solutions

Categories: Developers, Platform

Subscribe to our bi-weekly newsletter

Evaluating Cloud Financials Systems?

Don’t go any further until you’ve read Gartner’s analysis of what 10 leading vendors have to offer. You’ll also learn why Gartner named Acumatica a Visionary.