Refining the Message

You can refine the message to make it even more informative and useful to the recipient. Not only do you want the recipient to get a message, but you want that message to include the customer number and name for the new customer, so the recipient can look up the customer profile more easily.

To include the customer number and name in the message:

  1. On the Event Handlers form, select the handler that you created and then click Event Actions.
  2. On the Event Actions form, click Edit Parameters.
  3. On the Event Action Notify form, click the Body button.
  4. On the Event Action Expression Editor form, specify this information:
    Select a function
    Select SUBSTITUTE.
    Note: The SUBSTITUTE function allows you to specify the basic text of a message with replacement markers that are embedded in the message. At run time, the system substitutes specified values for these replacement markers. This effectively allows you to create messages with dynamic content.
    Argument 1
    Specify We have added a customer, {0}, customer ID {1}, to our family of customers.
    Note: The numbers enclosed in curly braces ( {0} and {1} ) are the replacement markers for which values is substituted at run time.

    Replacement markers must be enclosed in curly braces { }. They must begin with zero (0) and increment sequentially. If you do not begin with zero or you skip integers, they do not work.

  5. Create the expression that is used to supply the value for replacement marker {0}:
    1. Place the cursor in row 1 of the Arguments grid and then click Build Expression.
    2. On the Event Action Expression Editor form, from the Select a function drop-down list, select PROPERTY.
      The PROPERTY function picks up the value of the CustNum or Customer Number field.
    3. In the Argument 1 field, specify Name.
    4. Click OK.
  6. Repeat Step 5 for row 2 by using CustNum for the PROPERTY argument (propertyname) in substep c.
  7. On the Event Action Notify form, click OK.
  8. Optionally, on the Event Actions form, click Check Syntax.
  9. Save the action and close the Event Actions form.
  10. Discard the cached metadata.

Test by creating a new customer record and verifying that the intended recipient receives a notification message that includes the correct new customer name and number.