A humble attempt to help CRM Web UI developers to create and use alerts framework. During many of my projects I have come across scenarios where alerts have played a pivotal role to notify the users about some critical steps or decisions.
A very simple example could be as follows:-
I, as a Pre Sales Agent, am responsible for creating sales order in the CRM system and would like to have a functionality which takes care of notifying my sales manager or team leader in certain special business scenarios. For Example I want an alert to be created when I create a sales order which has a net value in excess of 1000$.
I would also like to attach a link to the Alert so that my manager is able to navigate directly from the alert screen to the CRM Sales Order and view its details.
There are 3 basic elements which we need to take care of when working on Alerts
1) Alert Category
2) Alert Container
3) Alert Recipients
Step 1 Creating a Alert Category Create an alert category using the transaction ALRTCATDEF:-
In the Properties tab some general information such as Priority, Description etc can be provided.
In this simplified example, I am not catering to the other 2 tabs.
Step 2 Triggering the Alert from ABAP Class or FM
Filling up the container:-
An alert container can be understood as a kind of data holder which will be used by the alert framework to identify the business object which needs to be processed.
In line with the case I had mentioned above , I want to trigger an alert if a particular condition is satisfied and I also want the user to have the flexibility to navigate to the business object (In our case it would be a Sales Order) from the alert screen.
The second step would be to read the CRM order details . This step is crucial as I need to attach a navigation link in my alert so that the sales manager can navgate to the correct sales order.
Read the One Order Header and Item Details
Get the business Object Details and Logical system. Every CRM one order object has a business object type associated to it and we need to use object type for the steps mentioned further in this blog. We would also require the logical system name because this is essential for the navigation to work correctly.
Fill the object key GUID, BOR Object GUID and BOR object type in the container
Fill the logical system ID in the container.
Fill the Object ID and Description in the container.
Step 3 :- Fill the list of recipients and Trigger the alert
Before we trigger the alert using the standard FM 'SALRT_CREATE_API', we need to prepare a list of recipients. In this example ,I am adding my user ID in this list. You can add more user IDs as per the business requirements.
This is the last step of triggering the alert, Please remember to use the Alert Category which was created in Step 1.