Customer and Contact Business Activities Plug-Ins

This appendix covers the following topics:

Business Activities Plug-Ins for Customers and Contacts

Oracle Sales enables consultants to provide customers with plug-ins to provide customized views of business activities for a customer or contact. The customized views must not contain any updateable items or columns. If a region is defined and implemented as described in this appendix, then a plug-in to display customized business activities can be added.

Business activities are accessible through the Business Activities selection drop down on the Customer and Contact details pages. Applicable activities are listed in the Business Activities selection drop down. By default, these business activities are provided:

Overview of Business Activities Customization

The framework of the business activities table is referred to in these steps as the business activities container. The table itself is referred to as the plug-in region. The content of the table is what you are defining and plugging in.

This is an overview of the steps to create an OA-based Business Activities plug-in:

Steps

  1. Define and implement view objects that get the results to display in the plug-in region. Also, define a Simplest Possible Expression Language (SPEL) property view object, which is used to dynamically render on and off the plug-in region.

  2. Define and implement the application module to contain the defined view objects.

  3. Define the plug-in region, which contains the results table.

  4. Define and implement the controller and associate it with the plug-in region.

  5. Add a lookup code to the business activities lookup type.

  6. Define a FND function.

Define and Implement View Objects

You must define and implement view object(s) to get the results to display in the plug-in region. Business activities are displayed in both customer and contact details, so the associated view object of the plug-in region must be able to support both areas. The plug-in region's results table is associated with the view object dynamically based on whether the business activities container is displayed in the customer or contact details pages.

While defining a view object, you must provide corresponding transient attributes for each amount and date field attribute. This can be used to show the amount or date column in the user's preferred Currency/Date format. This also requires a change in the getter method for the transient attribute in the VORowImpl class.

Also, you must define a SPEL property view object, which is used to dynamically render on and off the plug-in region.

After defining required view objects, you must associate them to the application module and the plug-in region. The following subsections list the steps to define required view objects.

Customer View Object - SQL Based

To define this view object:

Steps

  1. Define the view object business component with SQL statement.

    The SQL statement should have Filter on Customer ID as the bind parameter.

  2. Verify that the view attribute mappings are accurate.

  3. Generate the view object and view row implementation classes.

  4. In the View Implementation class, implement a method to run the view object query for the given customer ID.

Contact View Object - SQL Based

To define this view object:

Steps

  1. Define the view object business component with SQL statement.

    The SQL statement should have Filter on the Contact ID and/or the Customer ID as the bind parameter.

  2. Verify that the view attribute mappings are accurate.

  3. Generate the view object and view row implementation classes.

  4. In the View Implementation class, implement a method to run the view object query for the given customer ID and contact ID.

SPEL Property View Object - Transient

To define this view object:

Steps

  1. Define the view object business component with a transient attribute of type Boolean.

    This attribute is used to render on and off the plug-in region.

  2. Verify that the view attribute mappings are accurate.

  3. Generate the view row implementation class.

Define and Implement an Application Module

A business activities plug-in region must have its own application module. Define an application module and associate it to the plug-in region.

These are the functions of the application module:

Steps

  1. Initialize the SPEL properties view object.

  2. Initialize the view object query to fetch the results.

  3. Reset/Clear the view object associated with the table (results) region.

To implement an application module for a plug-in region:

  1. Define an application module business component.

  2. Associate the view object business components you have created to the new application module.

  3. Generate the application module implementation class. The implementation class must have these characteristics:

    • Implement a method that sets the Boolean attribute of the SPEL view object to TRUE or FALSE conditionally. Note that this view object must always have one row in it, and the Boolean attribute must be initialized to TRUE or FALSE.

    • Implement a method that executes the appropriate view object (customer and contact) for a given customer ID and contact ID. Note that the contact ID is available only if the base page is the contact detail page.

    • Implement a method named resetQuery(), that marks the view objects (customer and contact) as not prepared or not ready for execution by invoking the setPreparedForExecution(false) method on them.

Define the Plug-In Region

A business activities plug-in region must be defined as a stand alone region with a stack layout. The results table region is included by the stack layout region. It is recommended to prefix the region and item names with the corresponding product code of the plug-in region. The rendered property of the table region must be SPEL bound, so that it can be rendered on and off dynamically.

This plug-in region performs the function of List/Retrieve the data associated with a customer or customer and contact combination when a user selects this region from the business activities selection drop-down menu.

The following subsections describe how to define this plug-in region.

Plug-In Region

To define the plug-in region:

Steps

  1. Define a region of the type stackLayout.

  2. Associate the region to the application module.

  3. Using the stackLayout region, define a region of the type Table.

  4. Set the rendered property of the table region using the SPEL syntax. The value is derived at run time from the Boolean attribute of the defined SPEL view object.

  5. Set the records displayed property of the table region to 5.

  6. Associate each column and item to the appropriate attribute of the view object (customer and contact).

  7. Any columns and items of the table that perform a form action (for example, a hyperlink or a button), which enables the user to navigate out of the base page, should always throw a fire action parameter named ASNReqExitPage with the value of Y. This parameter is used by the base page to handle actions like implicit save before the user navigates out of the base page.

    Note that the plug-in region is not expected to have any updateable items or columns.

Input Parameters - Plug-in Region

Table Input Parameters for the Plug-in Region lists the input parameters for the plug-in region.

The parameter type is String for each input parameter.

Table H-1 Input Parameters for the Plug-In Region
Parameter Names Scope Description Required Possible Values
ASNTxnCustomerId Transaction Customer Party ID. Base page populates this parameter and stores it in the transaction. Yes Customer Party ID
ASNTxnRelPtyId Transaction Relationship Party ID. Base page populates this parameter and stores it in the transaction. This value is available only if the base page is the Contact details page.   Relationship Party ID
ASNBusActsPoplist Page Context The popup value selected from the business activities selection drop down. The business activities container passes this value to the underlying plug-in regions. The value for this parameter can be obtained from the page context. Yes Plug-in region's lookup code
EVENT_PARAM Page Context Name of the PPR event raised by the business activities selection drop down menu. The value can be obtained from the page context.   ASNBUSACTSPPR
ASNTxnAddBrdCrmb Transaction Base page sets this breadcrumb parameter in the transaction, which will be used during the page navigation from the business activities plug-in region. If no value is passed, then it should be defaulted as ADD_BREAD_CRUMB_YES.   ADD_BREAD_CRUMB_YES
ADD_BREAD_CRUMB_NO
ADD_BREAD_CRUMB_SAVE
ASNTxnReturnUrl Transaction Base page populates this parameter and stores it in the transaction. This can be used by the page navigation from the business activities plug-in region. Yes The URL string that is sufficient to navigate back to the base page.

Output Parameters - Plug-in Region

Table Input Parameters for the Plug-In Region lists the output parameters for the plug-in region.

The parameter type is String for each output parameter.

Table H-2 Input Parameters for the Plug-In Region
Parameter Names Scope Description Required Possible Values
ASNReqExitPage Page Content All component regions that are embedded in (plugged into) the customer and contact business activities container are presumed to be read-only. Any columns and items of the table that perform a form action (for example, a hyperlink or a button), which enables the user to navigate out of the base page, should always throw a fire action parameter named ASNReqExitPage with the value of Y to indicate that the user is leaving a current page. The base page can use this parameter to handle events like implicit commit before the user navigates out of the base page. Optional Y or N. Default is N.

Define and Implement the Controller

Define a controller and associate it with the defined plug-in region.

These are the functions of the controller:

Steps

  1. Associate the table region with the appropriate view object depending on whether the results are to be fetched for customer or contact.

  2. Initialize the view object (customer or contact) query.

  3. Initialize the SPEL property view object.

Plug-In Region Controller

To define and implement the controller:

Steps

  1. Define a controller webui component class

  2. In the processRequest() of the controller class:

    • Get the customer ID from the transaction parameter ASNTxnCustomerId.

    • Get the contact ID from the transaction parameter ASNTxnRelPtyId.

    • Get the business activities plug-in selection value from page context parameter ASNBusActsPoplist.

    • Set the view usage name of the table region and its child items and columns to an appropriate view usage name. Customer based view object usage name should be used if only customer ID is available. Contact based view object usage name should be used if both contact and customer IDs are available.

    • Based on the business activities plug-in selection value, set the SPEL view row Boolean attribute to either Boolean.TRUE or Boolean.FALSE. This ensures that the plug-in region is rendered only if it is selected from the selection drop down menu.

    • Run the appropriate view object (customer/contact) query for customer ID or customer ID and contact ID combination.

  3. In the process FormRequest() of the controller class:

    • Get the customer ID from the transaction parameter ASNTxnCustomerId.

    • Get the contact ID from the transaction parameter ASNTxnRelPtyId.

    • Get the business activities plug-in selection value from page context parameter ASNBusActsPoplist.

    • Get the form action event from page context parameter OAWebBeanConstants.EVENT_PARAM .

    • If the form action event is that of business activities plug-in selection drop-down event ASNBUSACTSPPR, then:

    • Based on the business activities plug-in selection value, set the SPEL view row Boolean attribute to either Boolean.TRUE or Boolean.FALSE. This ensures that the plug-in region is rendered only if it is selected from the selection drop-down

    • Run the appropriate view object (customer/contact) query for customer ID or customer ID and contact ID combination.

  4. Associate this controller to the plug-in region.

Add a Lookup Code

In order for a new plug-in region to appear in the business activities selection drop down menu, a new look up code must be added to the business activities lookup type. The default lookup type used by the business activities selection drop down is ASN_BUSINESS_ACTS.

It is recommended to prefix the new lookup code with the product code.

To add a lookup code:

Steps

  1. Add a lookup code to the lookup of type ASN_BUSINESS_ACTS.

  2. Set the meaning, tag, and enabled flag attributes of the lookup code.

  3. In the Description field, provide the full path to the VO package of the corresponding table region.

Define a FND Function

To load the plug-in region information at runtime, the business activities container must have access to the plug-in region metadata. Define a new FND function with the same name as that of lookup code and with the Web HTML value as the full package path of the plug-in region.

To define a FND function:

Steps

  1. Define a FND function with the same name as that of defined lookup code.

  2. Set the Web HTML Call attribute of the function to full mds package path of plug-in region.

    For example, /.../.../.../webui/<plug-in region name>. Note that there should not be any errors raised by the plug-in region controller while handling the exit page navigation events.