Example of Using an Extension to Get Data from Oracle Applications

Identify the public view object you need, then reference it in an order management extension.

Assume you need to use an order management extension to set the default value of the Freight Term attribute.

  • Use a descriptive flexfield to store the value for the Freight Term Code attribute.

  • Use an order management extension to get the value of the flexfield, then set the Freight Term attribute on the sales order.

You can get the value from the flexfield during testing. You notice that Order Management stores the value of the Freight Term Code as a number, but you need the meaning too. The WSH_FREIGHT_CHARGE_TERMS lookup stores the meaning.

You get the meaning, then use String vFreightTermsMeaning = lookupRow.getAttribute('Meaning'); to store it in a string, which you can then display in an attribute on the order header or the order line.

Try it.

  1. Go to Public View Objects in Oracle Applications Cloud (Doc ID 2386411.1).

  2. Download and open the XLS file for your update, such as Update 22A.

  3. In Microsoft Excel, open the POVs and Attributes worksheet.

  4. Click the Data tab, then click Filter.

  5. Click the Filter icon in row 1 of Column A.

    There are over 600,000 public view objects, so you need to filter for only the ones you need.

    There are over 600,000 public view objects, so you need to filter for only the ones you need.
  6. In the Filter dialog, in the search window, enter oracle.apps.scm.

    Most of the view objects you need are in the oracle.apps.scm path. Scroll through the search results in the Filter dialog so you can get an idea of the data you can access.

    In this example you need to get a value from shipping, so enter oracle.apps.scm.shipping in the search window, add a check mark to the Select All Search Results option, then click OK.

    For other examples, you might need to search and select values that start with a different value, depending on your requirements.

    Path

    Contains Data From

    oracle.apps.scm.doo

    Order Management

    oracle.apps.scm.pricing

    Oracle Pricing

    oracle.apps.scm.inventory

    Oracle Inventory Management

    oracle.apps.scm.productModel

    Product Information Management

    oracle.apps.scm.commonWorkExecution

    Work Execution

    oracle.apps.scm.dos

    Supply Chain Orchestration

    In some cases you might need to go outside of oracle.apps.scm. For example, use oracle.apps.prc to access purchase order data from Oracle Purchasing.

  7. Search for text that likely contains the data you need.

    You're looking for data in WSH_FREIGHT_CHARGE_TERMS, which is a type of lookup, so click the Filter icon in row 1 of Column B, then enter LookupType.

  8. Notice the results.

    Path

    Attribute

    oracle.apps.scm.shipping.carriers.publicView.CarrierModeOfTransportPVO

    LookupType

    oracle.apps.scm.shipping.carriers.publicView.CarrierServiceLevelPVO

    LookupType

    oracle.apps.scm.shipping.carriers.publicView.TransitTimeModeOfTransportPVO

    LookupType

    oracle.apps.scm.shipping.carriers.publicView.TransitTimeServiceLevelPVO

    LookupType

    oracle.apps.scm.shipping.common.publicView.analytics.WSHLookupsPVO

    LookupType

    oracle.apps.scm.shipping.common.publicView.ShippingLookupPVO

    LookupType

    oracle.apps.scm.shipping.shipConfirm.deliveries.publicView.SrLookupPVO

    LookupType

    Most of the paths reference specific kinds of data, such as mode of transport or transit time. You need the more generic lookup, which is in oracle.apps.scm.shipping.common.publicView.ShippingLookupPVO.

  9. Reference the public view object in your extension.

    def lookupPVO = context.getViewObject("oracle.apps.scm.shipping.common.publicView.ShippingLookupPVO");
    def vc = lookupPVO.createViewCriteria();
    def vcrow = vc.createViewCriteriaRow();
    
    vcrow.setAttribute('LookupType', 'WSH_FREIGHT_CHARGE_TERMS' );
    vcrow.setAttribute('LookupCode', <CODE> );
    vc.add(vcrow);
    def rowset = lookupPVO.findByViewCriteriaWithBindVars(vc, -1, new String [0], new String [0]);
    def lookupRow = rowset.first();
    String vFreightTermsMeaning = lookupRow.getAttribute('Meaning');

    where

    Code

    Description

    def lookupPVO = context.getViewObject("oracle.apps.scm.shipping.common.publicView.ShippingLookupPVO");

    Get the value from the oracle.apps.scm.shipping.common.publicView.ShippingLookupPVO

    vcrow.setAttribute('LookupType', 'WSH_FREIGHT_CHARGE_TERMS' );

    Set the value of the LookupType attribute to WSH_FREIGHT_CHARGE_TERMS.

    vcrow.setAttribute('LookupCode', <CODE> );

    Set the value of the LookupCode attribute. Replace CODE with the value of the lookup code.

    def rowset = lookupPVO.findByViewCriteriaWithBindVars(vc, -1, new String [0], new String [0]);

    Create the string where you will store the value of the meaning.

    def lookupRow = rowset.first();

    String vFreightTermsMeaning = lookupRow.getAttribute('Meaning');

    Get the value of the Meaning attribute, then store it in the string.