Good afternoon,
I want to update different fields from the orderForm, I updated for example the shippingData and clientProfileData following the vtexjs examples:
vtexjs.checkout.getOrderForm()
.then(function(orderForm) {
var clientProfileData = orderForm.clientProfileData;
clientProfileData.firstName = 'Guilherme';
return vtexjs.checkout.sendAttachment('clientProfileData', clientProfileData)
}).done(function(orderForm) {
alert("Nome alterado!");
console.log(orderForm);
console.log(orderForm.clientProfileData);
})
However I want to update the field salesChannel with the following structure:
vtexjs.checkout.getOrderForm()
.then(function(orderForm) {
var sc= '4'
return vtexjs.checkout.sendAttachment('salesChannel', { value: sc });
}).done(function(orderForm) {
console.log("openTextField preenchido com: ", orderForm.salesChannel);
}).fail(function(error) { console.log(error) } )
And always it returns a 500 error.
{"Fields":{},"operationId":"f464e572-cc53-4911-b050-68f9d95a3c6b","error":{"code":"1","message":"Specified argument was out of the range of valid values.\r\nParameter name: attachmentId","exception":null}}
Could anyone help me.
Thanks in advance.