Creating an Alert

From ADempiere
Revision as of 23:33, 25 December 2008 by Red1 (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Creating Alert

http://sourceforge.net/forum/message.php?msg_id=3938031 By: avdalen

I struggled with creating an Alert but now that I have it working, I would like to give a couple of pointers for anyone else who is trying it.

Pre-Requisites

  • Emailing must be working. Navigate to General Rules→Client Rules→Client to review, setup and test.

Example 1

  1. Log in as an admin (or role with appropriate access)
  2. Navigate to Performance Analysis→Performance Measurement→Alert
  3. Create a new record, name it Orders (or anything you prefer)
  4. Select an existing alert processor or create a new one. This alert processor is the component that will send emails the actual emails.
  5. Enter subject and alert message
  6. Mark as Valid
  7. Save record

Alert Rule Tab

  1. Create a new record, name it Orders Alert (or anything you prefer)
  2. In the sqlSelect field enter
    • "C_ORDER_ID","DOCUMENTNO","DOCSTATUS","TOTALLINES","GRANDTOTAL"
  3. In the sqlFrom field enter
    • C_ORDER
  4. In the sqlWhere field enter
    • ISACTIVE='Y' and ISSOTRX='Y'
  5. Mark as Valid
  6. Save record

Alert Recipient Tab

  1. Create a new record
  2. Select a User/Contact
  3. Save record

Testing the new Alert

Start the Application Server if not yet started.

Open compiereMonitor in a browser http://<your server>/compiereMonitor Navigate to the Alert processor that you assigned to your Alert. Click on run now

Navigate back to the Alert processor in the monitor and check the log.

If the alert failed, you would have to navigate back to the Alert window in compiere. Once the necessary corrections have been made, you have to mark the alert and alert rule as Valid again.

NOTE: Remember to restart the Application Server before you attempt to rerun the processor.


Example 2

Send an alert listing completed orders that are due for delivery within the next 7 days.

Create the Alert as per Example 1 above but this time assign the sqlWhere clause on the Alert Tab as:

  • sqlWhere clause
    ISACTIVE='Y' and ISSOTRX='Y' and DOCSTATUS='CO' and ISDELIVERED='N' and DATEPROMISED between sysdate and (sysdate +7)