Introduction

This article covers how to create a task in BPA Platform that sends an email when a specific database event occurs. Due to the flexibility of BPA Platform, this exercise focuses on the following scenario:

Email customers when they go over their credit limit

Objectives

Trigger the task when the on-hold field is updated
Extract data from a database
Populate a Crystal report with the extracted data
Email the report to a nominated person

Required Tools

Microsoft SQL Server TriggerClosed The Microsoft SQL Server Trigger tool uses the Microsoft® SQL Server™ trigger functionality to create a trigger on a table of a specified SQL data source. When a specified data modification is attempted, such as an attempt to add or delete a table row, the trigger then causes a task to run. — This step monitors a database table for an event; a change in a nominated field
Database Query (ODBC)Closed You typically use the Database Query (ODBC) tool to extract specific records from a relational database, using a valid ODBC driver to make the connection. These are then made available to other task steps as a recordset. — This step extracts the data required to populate the email
Run Crystal ReportClosed The Run Crystal Report tool automates the execution of SAP® Crystal Reports®. Recordsets and variables from other task steps can be consumed to dynamically populate the report at runtime. In addition, where the report requires access to a database, security credentials can be passed from in the Run Crystal Report step. — This step formats the data into a Crystal Report template
Send Email (SMTP)Closed The Send Email (SMTP) tool sends messages to any SMTP compliant mail server. This tool is capable of sending multiple messages in either text or HTML formats, incorporating data from Input and Format steps to any number of recipients. If recordset data being used from an Input step includes a column containing email addresses, then this can be used as a "dynamic" recipient address. — This step sends the email to the customer who exceeded their credit limit

This exercise only focuses on the settings needed to fulfil the task. For a detailed description of how to use each tool, refer to the individual tool's guides.

Note: For this article, we use the BPA Platform training database in place of a live customer database; where appropriate, substitute database and account details for your own when building this task. For a copy of the training database, contact your Codeless Platforms business partner.

See Also: How to Build an Email Alert Based on a Database Trigger — This article describes how to create a similar task that emails the account manager when their customer gone over their credit limit.

You could consider combining the tasks rather than having two separate tasks triggering off the same event.