How to use the correctly, Where to populate the fi...
# suitecommerce
l
How to use the correctly, Where to populate the field?
Copy code
var cart = container.getComponent('Cart');
			var data = {
				fieldId: "custbody_test_field",
				type: "string",
				value: "C123456"
			}

			cart.setTransactionBodyField(data).then(function() {
				console.log(data.fieldId + ' was set to ' + data.value);
			}).fail(function(error) {
				console.log('setTransactionBodyField failed.');
			});
Any of the following circumstances will cause this method to fail and return an error: • If there are no transaction body fields on the page. • If the specified transaction body field is not on the page. • If the value of
value
does not match the specified
type
in the TransactionBodyFieldData object. • If the value of
type
in the TransactionBodyFieldData object does not match the field type in NetSuite.
s
Try it in the checkout. If it works then you've stumbled upon issue 659128