Showing a Product Directory from Oracle Sales Cloud in Visual Builder Cloud Service

John Ceccarelli
Aug 25, 2017 · 2 min read

Oracle Sales Cloud (OSC) REST APIs have resources for Product Groups and Products. From this organizations can build deep multi-level product catalogs. But displaying and navigating these catalogs in a REST client like VBCS can be challenging.

With the help of VBCS custom code guru David Konecny, we recently built a catalog that looked like this:

The Product Groups REST API has the following quirks:

  • Product Group (/crmRestApi/resources/11.13.0.0/setupSalesCatalogs) has children called Subgroups and Products.
  • A Subgroup of a Product Group (/crmRestApi/resources/11.13.0.0/setupSalesCatalogs/{ProdGroupId}/child/ProductGroupSubgroupAdministration) is not a regular Product Group and doesn’t have all of its properties, most notably the list of the subgroup’s subgroups.
  • Similarly a Product in a Product Group (/crmRestApi/resources/11.13.0.0/setupSalesCatalogs/{ProdGroupId}/child/ProductGroupProductSetup) is not a regular Product (/crmRestApi/resources/11.13.0.0/products) and is missing key properties.

The problem here is that when you dig into one of those subgroups what you want to show is not a ProductGroupSubgroupAdministration object but just a plain old Product Group. To accomplish this, we have to bust into some custom code.

  1. Drop a list and hook it up to Product Groups business object. Only enable the Details action.
  2. In the Product Group Details page, drop a list and bind it to Subgroups. Don’t add any of the CRUD action pages.
  3. Select the Subgroup name and go to Actions tab in the Property Inspector. Add a new Custom Action.
  4. Add a custom JavaScript block to the action and enter this code:
// Replace com_oracle_abcs_fa_V7OhT with the variable used in your page
// Get the ProdGroupId for the subgroup

var prodId = $com_oracle_abcs_fa_V7OhT_setupSalesCatalogs_ProductGroupSubgroupAdministrationListArchetypeRecord.getValue('ProdGroupId');
// Create a new record with the ProdGroupId
var record = new Record({'_breeze_system_id' : prodId});
// Navigate to the ProductGroup details page and pass in the record with the ProdGroupId Abcs.Pages().navigateToPage('com_oracle_abcs_fa_V7OhT_setupSalesCatalogsPage',
ContextualData.createRecordToEditContext({entityId: 'com.oracle.abcs.fa.V7OhT.setupSalesCatalogs', data: record}));
resolve();

To set up the Product links do the same thing.

  1. Drop at list and bind it to the Products child (ProductGroupProductSetup) of the Product Group.
  2. Set the action on the product name to this custom JavaScript:
var prodId = $com_oracle_abcs_fa_V7OhT_setupSalesCatalogs_ProductGroupProductSetupListArchetypeRecord.getValue('InventoryItemId');var record = new Record({'_breeze_system_id' : prodId});Abcs.Pages().navigateToPage('ProductDetail',
ContextualData.createRecordToEditContext({entityId: 'com.oracle.abcs.fa.xPiEu.products', data: record}));
resolve();

This assumes that you’ve already created the ProductDetail page by going to the list of pages, creating a new Page of type Detail, and binding it to the Product (/crmRestApi/resources/11.13.0.0/products) Business Object.

Aggregation of articles from Oracle & partners engineers, Groundbreaker ambassadors & the developer community on all things Oracle Cloud and its technologies. The views expressed are those of authors solely and do not necessarily reflect Oracle's. Contact @jimgris or @brhubart

)

John Ceccarelli

Written by

Director of Product Management, Visual Builder Cloud Service, Oracle

Oracle Developers

Aggregation of articles from Oracle & partners engineers, Groundbreaker ambassadors & the developer community on all things Oracle Cloud and its technologies. The views expressed are those of authors solely and do not necessarily reflect Oracle's. Contact @jimgris or @brhubart

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade