Salesforce

How Do I Define Application Level Events? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Define Application Level Events? (Magic xpa 3.x)

In Magic xpa, you can define events to happen in any task. However, sometimes you will want an event that can be triggered from any task, or when no task is running. For example, you may have a messaging system that checks for messages every few minutes, or a global error handler that gives a message for any unhandled database errors, or a pop-up program that is set to a hot key, which runs on top of any current task.

These global events are always coded in the Main Program of the project.

Creating a global event

  1. Open the Main Program.

  2. Click on the Logic tab (Ctrl+1).

  3. Press F4 (Edit->Create Line) to add a line. Two new lines will appear. Go to the first line and select Event from the drop-down list.

  1. Tab to the right. An Event dialog box will appear.

  2. Choose the event type you want to use. In this example we are using a system event, which is a keystroke.

  3. Zoom (F5, Edit->Zoom) from the Event field. This will bring up a Key Definition dialog box.

  1. Press the keystrokes you want to use to trigger the event. In this case we used Alt+Z.

  2. Now you have a global event that will be triggered when Alt+Z is pressed. All you have to do is add whatever logic you want to execute when the event is triggered.

Here, we added a call to “Zip Code Lookup” which would show a list of states and zip codes.

See also

Reference
Attachment 
Attachment