Hi Guys, I'm unable to get the item information us...
# suitecommerce
m
Hi Guys, I'm unable to get the item information using contextDataRequest
Copy code
define('TEM.CDPShowUoM.uomModule.View',	['tem_cdpshowuom_uommodule.tpl', 'Backbone'], function (tem_cdpshowuom_uommodule_tpl, Backbone){
    'use strict';

	return Backbone.View.extend({

		template: tem_cdpshowuom_uommodule_tpl,
		contextDataRequest: ['item'],			
		initialize: function (options) {
			console.log(this);
			console.log(options);
		},		
		events: {
		},	
		bindings: {
		}, 	
		childViews: {

		},

		//@method getContext @return TEM.CDPShowUoM.uomModule.View.Context
		getContext: function getContext()
		{
			console.log(this.contextData.item());
			console.log('getContext this');
			console.log(this);
			this.message = this.message || 'Box'
			return {
				uomValue: this.message
			};
		}
	});
});
I'm trying to get this in View Cart Page in SuiteCommerce Standard extension I followed the article shared by @Steve Goldberg but still it doesn't work am i doing wrong any response wuld be appreciated
s
The issue is, based on your previous comments, is that you are trying to do this in the Cart view. Which, as I pointed out in the doc I linked you, is not one of the views where contextDataRequests are allowed.
m
Oooh, any idea how can i show the custom field in view cart page each item
s
The SC Custom Fields extension is usually the solution for this. There are docs for the PDP and Checkout but I’m reasonably sure it will also show on the cart page. If it doesn’t then you’ll need to write a customisation https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/subsect_156174139171.html#Custom-Fields-for-the-PDP