contextData and contextDataRequest Properties in SuiteCommerce
contextData and contextDataRequest properties enhance data accessibility in SuiteCommerce views, enabling flexible data handling.
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 Type | Class Availability | Information Returned |
|---|---|---|
| category | Facets.Browse.View | The category model |
| item | ItemRelations.RelatedItem.View | The item model |
| Facets.ItemCell.View | ||
| ProductDetails.Base.View | ||
| itemlist | Facets.Browse.View | An object that contains the complete item collection |
| product | ProductDetails.Base.View | The 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
contextDatais 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?
How does the `contextDataRequest` property improve data handling in SuiteCommerce?
Can child views inherit `contextDataRequest` properties in SuiteCommerce?
Are there specific conditions under which `contextData` will be populated in a SuiteCommerce view?
Was this article helpful?
More in Commerce
- Available Items Only Feature in NetSuite 2026.1
Available items only filtering boosts sales efficiency in NetSuite 2026.1 with Intelligent Item Recommendations.
- Commerce Extensions in NetSuite 2026.1
Commerce Extensions in NetSuite 2026.1 enhance performance and user experience in eCommerce.
- Convert Multiple Transaction Line Items into Configured Items in
Enhance transaction processing in NetSuite by converting multiple line items into configured items with improved session handling.
- New SuiteCommerce Features in NetSuite 2026.1
New SuiteCommerce features in NetSuite 2026.1 enhance user experience and improve eCommerce efficiency.
