Testing an Event and Script Association
In this scenario we install a test script and we associate the test script with an event. When the event triggers, the script displays the “EVENT TEST” pop-up message.
You can associate the test script with any event. When the “EVENT TEST” message appears in a pop-up window, you know the event that triggered the test script.
During your script development, create the association between the test script and the event you want to script first, then replace the test script with your developed script. This way, you know that you associated the developed script with the correct event.
To create the test script
From the Classic Admin portlet, click
.Click Submit to return a list of existing scripts.
Click Add.
Enter the following two script lines in the Script Content section:
aa.env.setValue("ScriptReturnCode","1"); aa.env.setValue("ScriptReturnMessage", "EVENT TEST");
Enter the name “EVENT_TEST” in the Script Code and Script Title sections.
Click Add.
Topics
Associating the script to an event
To associate an event to the test script
From the Classic Admin portlet, click
.Click Submit to return a list of existing events.
If required, add a new event.
Click Add.
Select the event name from the Events drop-down list, then click Add.
Select an existing event by clicking on the red dot to the left of its name.
From the Event Detail screen select the script “EVENT_TEST” from the Script Name drop-down list.
Click Save.
Testing the event
Test the event to script association by triggering the event with a test case. For example, to test the “ApplicationSubmitAfter” event, create a new record of any type and click Submit, he “EVENT TEST” message appears in a pop-up window.
To disassociate the script from the event
From the Classic Admin portlet, click
.Click Submit to return a list of existing events.
Select the event by clicking on the red dot to the left of its name.
From the Script Name drop-down list, scroll to the top of the list and select the blank entry.
Click Save.
To delete the event
From the Classic Admin portlet, click
.Click Submit to return a list of existing events.
Select the event by clicking on the red dot to the left of its name.
Click Delete to disable the event.