Salesforce

How Do I Raise Events Defined in the Host Application from a Component? (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

How Do I Raise Events Defined in the Host Application from a Component? (Magic xpa 4.x)

Sometimes it is useful to be able to raise an event in a component that can be handled in the host component. For instance, it is common for packaged routines to raise an event if an error happened. In our example here, we raise an event in the component called “LogCall”, which passes parameters about the call, so the host application can store the information if needed.

Raising the host event

  1. Create your Raise Event operation in the location you want it. The Event dialog will appear.

  2. Go to the Event type field. Select Public Event.

  3. Go to the Event field. Zoom, which will bring you to the Expression rules. Type in the name of the event, spelled exactly as it will be in the host event, in single quotes.

This will cause the component to raise an event that can be handled by the host component. Now you need to set up the host component to capture the event.

Handling the event in the host

  1. Create an event in the Main Program, with the exactly the same Public Name as the event you raised in the component.

  2. Check the Expose box.

Now, you can create handlers to handle the event as needed.

Reference
Attachment 
Attachment