Refining the Recipient

When defining the recipients for this message, it can be a good idea to use a global constant value, rather than a hard-coded user ID. This allows you to use the same global constant value in other places in your application. Then, if the name of the credit manager changes, for instance, it is possible to change the recipients by simply changing the global constant value. It also allows you to add multiple recipients, for instance, if you have co-credit managers or you have a trainee you want to also receive the messages.

To redefine the recipients as a global constant:

  1. Create the global constant:
    1. Open the Event Global Constants form.
    2. Press F3.
    3. Specify this information:
      Name
      Specify CreditMgr or the name to assign to the constant.
      Value
      Specify the logon user ID for the credit manager.
      Note: To add multiple recipients, specify the user IDs separated by semi-colons only and no spaces.
    4. Save the global constant and close the form.
  2. Incorporate the global constant in the event handler action:
    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 To button.
    4. On the Event Action Parameter Recipients form, click the Recipients button.
    5. On the Event Action Expression Editor form, specify this information:
      Select a function
      Select GC.
      Note: The GC function calls a specified global constant and uses its value at run time. In this case, you want the global constant you created in Step 1.
      Argument 1
      Select the global constant that you created in Step 1 (CreditMgr).

      Notice that the global constant name is not enclosed in double quotation marks. Generally, only literal strings and property names must be enclosed in double quotation marks.

    6. Click OK.
    7. On the Event Action Parameter Recipients form, click the OK.
    8. On the Event Action Notify form, click the OK.
    9. To verify that there are no syntax errors, click Check Syntax.
    10. Optionally, on the Event Actions form, click the Substituted Parameters tab.
      Notice that the TO parameter indicates the actual recipient or the value of the global constant.
    11. Save the action and close the Event Actions form.
Test by creating a new customer record and verifying that all designated recipients receive the notification message. You can also check the Saved Messages form for the user ID from which you were signed in when the message was sent.