Enable Price Books for Opportunities

Improve the speed and accuracy of sales representatives' pricing discussions with their customers by bringing Account and Opportunity based pricing into CX Sales Mobile.

To get started with enabling this feature, first follow all of the steps listed in the Price Books in Opportunities and Accounts section of the Price Books chapter, available in the Implementation Reference guide.

After completing this, continue with these steps to enable for CX Sales Mobile.

Add the Price List Fields You Created to Mobile Account and Opportunity Pages

Add the Price List fields you created in the “Create Price Book Field for Accounts and Opportunities” topic to their respective CX Sales Mobile Account and Opportunity Summary and Edit pages. Here’s how to add the fields:

  1. Sign in to the Oracle CX Sales application as user with a Sales Administrator role.
  2. Create a publishable sandbox that includes Application Composer.
  3. Open Application Composer by selecting Application Composer under the Configuration category in the Navigator menu.
  4. Under the Common Setup Menu, or on the Overview page, click Mobile Application Setup.
  5. Click the CX Sales Mobile Composer tab.
  6. In the Application Features pane, click Accounts.
  7. In the Accounts Views pane, click Summary.
  8. Click the Click to Clone icon next to the default Account Detail layout and name the new layout. Click Ok.
  9. Open the Assigned Roles pane and search for the custom Sales Representative role with the Manage Price Books role. Add the role by clicking the role name.
  10. Add the Price List field to this layout by selecting + Add Field in the location you would like the field to appear. Search for the Price List field and click the field name to add it to the layout.
  11. In the header, click Save.
  12. In the Accounts Views pane, click Edit
  13. Click the Click to Clone icon next to the default Account Detail layout and name the new layout. Click Ok.
  14. Open the Assigned Roles pane and search for the custom Sales Representative role with the Manage Price Books role. Add the role by clicking the role name.
  15. Add the Price List field to this layout by selecting + Add Field. Search for the Price List field and click the field name to add it to the layout.
  16. In the header, click Save.
  17. Repeat steps 6 to 16 for Opportunities.

Create a Script to Apply Updated Pricing When the Price List Field Value Is Changed

Next, create a mobile script that updates the unit pricing for Revenue Line Items, multiplies them by Quantity to get the Line Item Totals, and updates the Opportunity Revenue when the Price List field value is changed. Here’s how to create the script:

  1. Click the CX Sales Mobile Scripts tab.
  2. In the CX Objects pane, click Opportunities
  3. In the Opportunities Event pane, click On Field Value Change.
  4. In the Select Dependent Field pane, choose Price List.
  5. The Price List Scripts pane appears above the Select Dependent Field pane. Click the + icon in the Price List Scripts pane to add a script.
  6. In the Script Name field, enter OnFieldValueChange_PriceList and add a suitable description in the Script Description field.
  7. Click Create.
  8. Enter the following script:
    const row = getCurrentRow();
    let priceListName = row.getColumn('PriceList_c');
    if(!(priceListName == null)){
    let q = queryWithParameters("priceBookHeaders", [{'field': 'Name', 'operator': 'contains', 'value': priceListName}]);
    let rows = q.execute();
    let priceBookItems = rows[0].getColumn('PriceBookItem').items;
    let prodGroupItems = row.getColumn('ChildRevenue').items;
    for(var i =0; i< prodGroupItems.length; i++){
    for(var j =0; j< priceBookItems.length; j++){
    if(prodGroupItems[i].Description === priceBookItems[j].ItemDescription){
    prodGroupItems[i].UnitPrice = priceBookItems[j].ListPrice;
    prodGroupItems[i].RevnAmount = priceBookItems[j].ListPrice * prodGroupItems[i].Quantity;
    break;
    }
    }
    }
    }
  9. Click Validate.
  10. In the header, click Save.

Create a Script to Apply Updated Pricing When the Revenue Line Item Is Changed or Added

Lastly, create a mobile script that updates or fills in the unit price, multiplies them by Quantity to get the Line Item Totals, and updates the Opportunity Revenue when a Revenue Line Item is changed or an additional item is added. Here’s how to create the script:

  1. Select the CX Sales Mobile Scripts tab.
  2. In the CX Objects pane, click Opportunities.
  3. In the Opportunities Child Objects pane, click Opportunity Revenue.
  4. In the Opportunity Revenue Events pane, select On Field Value Change.
  5. In the Select Dependent Field pane, search for and select Product Group.
  6. The On Field Value Change Scripts pane appears above the Select Dependent Field pane. Click the + icon in the On Field Value Change Scripts pane to create a new script.
  7. In the Script Name field, enter onfieldvaluechange_productgroup and add a suitable description in the Script Description field.
  8. Click Create.
  9. Enter the following script:
    const row = getCurrentRow();
    let priceListName = row.getColumn('PriceList_c');
    let q = queryWithParameters("priceBookHeaders", [{'field': 'Name', 'operator': 'contains', 'value': priceListName}]);
    let rows = q.execute();
    let priceBookItems = rows[0].getColumn('PriceBookItem').items;
    const childRow = getCurrentChildRow();
    let productName = childRow.getColumn('Description');
    for(var i =0; i< priceBookItems.length; i++){
    if(priceBookItems[i].ItemDescription === productName){
    childRow.setColumn('UnitPrice',priceBookItems[i].ListPrice);
    break;
    }
    else {
    childRow.setColumn('UnitPrice',null);
    }
    }
  10. Click Validate.
  11. In the header, click Save.

Test Your Configurations

Test your updates and publish the sandbox when you're happy with the configuration. See the Test Your Configurations topic for details about how to check your mobile configurations.