Extend Application Pages for Sales Orders

Using Application Composer, you can change many items that appear on the application set of pages for sales orders. The Sales Order object is available to support the integration with Oracle Configure, Price, and Quote (CPQ) Cloud.

This object stores quote summary information that's synced from Oracle CPQ Cloud.

Note: Do not extend the Sales Order object unless the integration with Oracle CPQ Cloud has already been set up. For more information, see "About Integrating with Quotes" in the Related Topics.

The Sales Order object displays as a subtab in the following areas:

  • Quotes and Orders subtab for account records

  • Quotes and Orders subtab for opportunity records

Use Application Composer to create custom attributes (custom fields) on the Sales Order object. The custom fields you create are available for display on the Quotes and Orders subtab for account and opportunity records, as well as for use with web services.

For example, you can:

  • Hide or show standard fields.

  • Reorder columns.

  • Add custom fields (all types).

Modify the Sales Order Object

After the integration with Oracle CPQ Cloud has been set up, you can define custom fields for the Sales Order object.

To define custom fields:

  1. Navigate to Application Composer.

  2. Expand the Sales Order object.

  3. Click the Fields node.

Configure the Quotes and Orders Subtab

Next, configure the Quotes and Orders subtab, available from both the Account or Opportunity details page. To configure the subtabs, you must navigate to the Account or Opportunity page layouts in Application Composer.

  1. Navigate to the Account or Opportunity object in Application Composer.

  2. Click the Pages node.

  3. On the Application Pages tab, navigate to the Details Page Layouts section. Create a custom layout by duplicating the standard layout, or edit an existing custom layout.

  4. On the Details Layout page, click the Quotes and Orders subtab. You can:

    • Click the pencil icon next to the subtab name to rename the subtab.

    • Click the pencil icon next to the Opportunity Quotes or Customer Quotes heading to indicate which of the sales order attributes (standard or custom) are displayed at runtime.

Access the Sales Order Object for Custom Scripting

After you configure the Sales Order object, you can also write Groovy scripts that access the new custom fields you created. For example, maybe you want to validate sales order data on an opportunity. However, when writing the script on the Opportunity object, custom fields from the Sales Order object aren't available directly in the expression builder. To access those custom fields, you must use the newView() function to build a runtime link to the Sales Order object. After newView() executes against the Sales Order object, only then can your script access and analyze Sales Order fields.

Here's an example of the newView() function that retrieves the related sales order record based on the opportunity number.

def myVO = newView('SalesOrderHeader')
def view_Criteria = newViewCriteria(myVO);
def view_criteria_row = view_Criteria.createRow();
def view_condition = view_criteria_row.ensureCriteriaItem('OptyNumber');
view_condition.setOperator('=');
view_condition.setValue(OptyNumber);
view_Criteria.insertRow(view_criteria_row);
myVO.appendViewCriteria(view_Criteria);
myVO.setMaxFetchSize(1);
myVO.executeQuery();

if(myVO.hasNext())
{
def rec= myVO.next()
def cust_field_from_order_value = rec.<custom_field_API_name>_c
}

This line, specifically, gets the value of a custom Sales Order attribute and assigns it to a variable.

def cust_field_from_order_value = rec.<custom_field_API_name>_c

You can now complete the rest of the Groovy script to implement a validation rule, for example.