Salesforce

How Do I Raise a Dynamically Named Event? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Raise a Dynamically Named Event? (Magic xpa 3.x)

There might be occasions where you want to raise an event using its text name. This might be the case, for instance, if you are raising an event in the host program from a component: you cannot just select the event because it is not in scope. Or, you might want to select between various events based on user input, or store the event name in a table.

In our example, we allow the user to choose the event from a list of events, then execute the chosen event.

Set up the event in the Main Program

Before you can call a dynamically-named event, you must set up the event in the Main Program, and give it a Public Name. Here we have our events: Chat, Send, Receive, and LogCall.

Call the event with a Call public

Next, you need to call the event.

  1. Go to the location where you want to raise the event.

  2. Type R to create a Raise Event operation. The Event box will appear.

  3. Go to the Event Type field. Select Public Event.

  4. Go to the Event field. Zoom to enter an expression. Make that expression evaluate to the exact name of the event (case matters, as do trailing spaces).

In our example, the user chooses an item from a list, which happens to be the exact name of the event. We just trim the spaces off it and raise it as a Public Event.

See also

The Online and Rich Client Samples projects (program EH08 and REH08)

Reference
Attachment 
Attachment