Step 4. Test your Employee Salary Trigger
FRM105 - A Trigger Function
To fully test your trigger, you require an email client such as Microsoft Outlook.
- In this step you will change an employee salary by more than 1,000. Your email client will warn you that a 'third party' is sending an email.
- Access your email account to which the message was sent. The Inbox should contain a message generated by the trigger function.
- Access the employee record and note that the trigger has prevented the change being made. Salary has not been changed.
- Make the required salary change by changing the business phone number to A100 at the same time as changing the salary. This time no email message will be generated
- Access the employee record again to confirm the salary has changed. Note that the trigger has set business phone number to N/A.
1. Ensure that your email client is started.
2. Execute form iiiCOM18. Fetch an employee such as A0090. Change salary by more than 1,000. The trigger function will be called, which will try to send an email. Your email client will display a warning dialog, which you should allow to continue.
3. Retrieve the email, which should look like the following:
The URL include illustrates how a WAM could be called to make the required salary change, passing in the required employee number (EMPNO).
4. Run form iiiCOM18 and make the required salary change, changing business phone number to A100 at the same time.
Note that this time an email message is not sent.
5. Retrieve this employee again, using form iiiCOM18. Note that the business phone number has been changed by the trigger function to N/A. This allows a further salary change to be correctly handled by the trigger function.