contextData and contextDataRequest Properties in SuiteCommerce

contextData and contextDataRequest properties enhance data accessibility in SuiteCommerce views, enabling flexible data handling.

·2 min read·View Oracle Docs

The contextData and contextDataRequest properties in SuiteCommerce are essential for developers working with dynamic views and data management. These properties facilitate the retrieval and handling of contextual information relevant to user interactions on different views.

What is contextData?

contextData is a property associated with every view in SuiteCommerce, although it contains data only in certain views. This property enables developers to access contextual information specific to a view instance. For instance, on a product details page (PDP), contextData may provide key insights related to the product being displayed.

What is contextDataRequest?

The contextDataRequest property is only available in views that are children of those containing contextData. By using contextDataRequest, you can specify an array of data types you would like to retrieve. This allows for optimized data requests tailored to specific needs.

Supported Object Types

Views can return up to four types of objects, and each view may cater to various object types based on its class. Here are the typical object types and their class availability:

Object TypeClass AvailabilityInformation Returned
categoryFacets.Browse.ViewThe category model
itemItemRelations.RelatedItem.ViewThe item model
Facets.ItemCell.View
ProductDetails.Base.View
itemlistFacets.Browse.ViewAn object that contains the complete item collection
productProductDetails.Base.ViewThe parent model for a product, including the item model

Cascading Availability

The availability of contextData follows a cascading structure. This means that child views can inherit contextDataRequest properties from their ancestors. Therefore, if a child view is nested under a parent or grandparent view that includes contextData, it will have access to the necessary data requests.

Important Considerations

  • contextData is populated only in the view classes specified in the table and their child views.
  • Make sure to check which models are supported based on the specific product or item view currently in use, as this varies across different instances.

By understanding these properties, developers can enhance their SuiteCommerce applications' interactivity and provide users with dynamic, data-driven experiences.

Frequently Asked Questions (4)

What views have access to the `contextData` property in SuiteCommerce?
The `contextData` property is only available in certain views like Facets.Browse.View, ItemRelations.RelatedItem.View, Facets.ItemCell.View, and ProductDetails.Base.View as well as their child views.
How does the `contextDataRequest` property improve data handling in SuiteCommerce?
The `contextDataRequest` property allows for the specification of an array of data types to be retrieved, optimizing the data requests for specific view needs and enhancing data manageability.
Can child views inherit `contextDataRequest` properties in SuiteCommerce?
Yes, child views can inherit `contextDataRequest` properties from parent views that have `contextData`, following a cascading structure.
Are there specific conditions under which `contextData` will be populated in a SuiteCommerce view?
Yes, `contextData` is populated only in certain specified view classes and their child views, as detailed in the table within the SuiteCommerce article.
Source: contextData and contextDataRequest Properties Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Commerce

View all Commerce articles →