Step by Step Guide To Event Based Alert
Step by Step Guide To Event Based Alert
2011
Contents
INTRODUCTION ................................................................................................................................................. 3 HOW TO CREATE EVENT ALERT ............................................................................................................................ 3 Define Alert ............................................................................................................................................... 3 Define Alert Action.................................................................................................................................... 7 Define Action Set .................................................................................................................................... 10 Define Alert Details ................................................................................................................................. 11 ALERT EMAIL .................................................................................................................................................. 13 TROUBLESHOOTING ......................................................................................................................................... 13
2|Page
INTRODUCTION
There are two types of alerts available in Oracle Alerts Module. 1. Periodic Alerts 2. Event Based Alerts In this article we are going to cover event based alerts. Which helps to send email notification in case of a specific event on a database table. Following are the two events which can be used. After Insert After Update For Example: If your payables department wants to have a notification whenever a receipt is made in Inventory Department. Same way you can have different scenarios based on your business requirements.
3|Page
4|Page
Select Application as Purchasing and Name the Alert for Example On Receipt Go to Event Tab Select the Application Purchasing and Table as RCV_TRANSACTIONS This table is very important thing to understand. You have to select the table In which data is being Inserted or Updated and for that data you want to send a alert. For example: If you want to have an alert in case an Employee is Created or Terminated. So you have to select Application as Human Resources. And when an Employee is created, data is inserted in per_all_people_f so you have to use per_all_people_f as event table in your alert definition.
5|Page
Select After Insert if you want to send alert when a new record is created. In the same way After Update will help you to send alert when a record is updated. Based on your requirement you can use both together.
2nd Important step is to write a select query, which helps you to select your required information when Alert is triggered. Example Query: This Query Select PO Number, PO Line & Receipt Number.
SELECT poh.segment1, pol.line_num, rcvsh.receipt_num INTO &PO_NUMBER,&PO_LINE,&RECEIPT_NUMBER FROM po_headers_all poh, po_lines_all pol, po_distributions_all pod, rcv_transactions rcvt, rcv_shipment_headers rcvsh WHERE poh.po_header_id = pod.po_header_id AND poh.po_header_id = pol.po_header_id AND pod.po_line_id = pol.po_line_id AND rcvt.source_document_code = 'PO' AND rcvt.po_header_id = poh.po_header_id AND rcvt.po_line_id = pol.po_line_id AND rcvt.shipment_header_id = rcvsh.shipment_header_id and rcvt.TRANSACTION_TYPE = 'DELIVER' AND rcvt.TRANSACTION_ID IN (SELECT TRANSACTION_ID FROM rcv_transactions WHERE rowid=:ROWID ) 6|Page
Note: You must have to write select statement on same table which you have used in Alert Definition to get :ROWID :ROWID returns the row id of the data being inserted or updated in your table.
7|Page
You can define four type of Alert Actions. It depends on your requirements. 1. 2. 3. 4. Concurrent Program ( This helps to execute a concurrent Program ) Operating System Script ( Run OS Script ) Message ( Send a Email Notification ) SQL Statement Script ( Execute a SQL Script )
In this example we are using alert to send email notification. Refer to above screenshot. Write Email address of the recipient User in TO field. Write Subject of Email
8|Page
In Text you have to write your Message Using your variables which you have used in Query. My Alert Text is as below.
Hi
PO = &PO_NUMBER
POLine = &PO_LINE
Regards, My IT Department
9|Page
10 | P a g e
Select the action you defined. Please make sure action is marked as enabled. Save. Close Action Set
11 | P a g e
Go to Installations Tab
Select your oracle ID as apps and your OU. Save. Close the Alert Details
12 | P a g e
ALERT EMAIL
To test this alert, create a material Receipt against PO. You will receive a notification.
TROUBLESHOOTING
To troubleshoot any problem, review the concurrent program log. For each alert system fires a alert concurrent program.
13 | P a g e