Share via


Example: Planning an event

The following example explains how to plan the event for the result viewers displayed on the Leads information page in the BPSDK sample for Great Plains.

  1. Decide which result viewers will be involved.

Three result viewers are involved in the event for the Leads information page. One result viewer will display a list of Leads, allowing a user to select a Lead. The other result viewers will display detailed information about the selected lead.

The following illustration provides a sketch along with a description of each of the result viewers displayed in the Leads information page.

[spacer]

  1. Determine what keys will be published when the event occurs.

An event occurs when a lead is selected in the Leads Primary Publishing List. The query displayed by this result viewer is based on a data permission for the Lead entity. When a lead is selected from the list, a single name/value pair will be published as a key to both subscribers. The name of the key is LeadID, and the value published will be the value of the LeadID property for the lead selected in the list.

Both the Lead Information Form Viewer and the Lead Note Content Viewer subscribe to this event, so they will listen for the event. When the event occurs, they will use the information published by the Leads Primary Publishing List to update their queries.

  1. Determine the parameters needed in the queries displayed by the subscribers.

Both the Lead Information Form Viewer and the Lead Note Content Viewer subscribe to the event published by the Leads Primary Publishing List. Therefore, both of these result viewers must display a query that contains at least one parameter since they subscribe to an event. Only one parameter is needed in each of the queries since only one key is published when a lead is selected in the Leads Primary Publishing List. The parameter name will be the same for both queries since they are responding to the same event. The name of the parameter will be LeadID, which is the name of the key published by the Leads Primary Publishing List.

  1. Determine the EventAlias and EventNameSpace properties.

The EventAlias property for the Leads Primary Publishing List must be set to the alias of the dynamic view whose keys are published when the event occurs. The alias of this dynamic view is Lead. The EventNameSpace property for each of the subscribers, Lead Information and Lead Note, must be set to the fully-qualified name of the entity whose values they expect to receive when the event occurs. Since both subscribers expect to receive values for the Lead entity’s LeadID property, the EventNameSpace property for both result viewers must be set to the fully-qualified name of the Lead entity, which is BPSDK.Sample.Lead.