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
- SuiteCommerce CAPTCHA Configuration Options and Setup
Configure SuiteCommerce CAPTCHA for enhanced security. Enable CAPTCHA for registration, login, guest checkout, and orders.
- Single Sign-On Integration for NetSuite Web Stores
Implement inbound single sign-on integration for NetSuite web stores using SAML or OpenID Connect for seamless access.
- Facets Management for Commerce in NetSuite
Facets management in NetSuite Commerce optimizes item search filters, enhancing performance and improving user experience.
- SuiteCommerce Analytics Data and Cookie Consent Integration
SuiteCommerce Analytics Data enables tracking of shopper behavior. This requires a cookie consent extension for user preferences.
Advertising
Reach Commerce Professionals
Put your product in front of NetSuite experts who work with Commerce every day.
Sponsor This Category