Hello Everyone, I have observed an issue with the...
# suitecommerce
s
Hello Everyone, I have observed an issue with the
updateLine
method of the
Cart
component. In the Extensibility API documentation, it says that the
updateLine
method ignores all other parameters except
internaid
&
quantity
but in reality, it throws an error when you try to add/update any custom transaction line field. This issue has been occurring since the release of 2023.2.0 of SCS/SCA where NetSuite has added a separate code block to compare the line options while updating a line item that caused this issue. @Steve Goldberg @Flo It would be great to have a new method for the
Cart
component to add/update line option fields in the next major release. Thanks
s
Sorry, I’m confused. Are you saying that you were using an undocumented/unsupported property in the object you provided to the
updateLine()
method and now it doesn’t work?
If so… well, yeah. We never said it would do that.
Anyway, I just tested your use case and it still seems to work fine for me on 2023.2
s
@Steve Goldberg Yes, that's correct. Before v2023.2, the
updateLine
method was successfully saving custom transaction line field values, but it stopped that process in v2023.2. The documentation neither mentions supporting that action nor will it cause any errors for other passed parameters.
Did you test the above code on SC v2023.2? And is the
costcol1
a custom transaction line field (not a transaction option field)?
s
Ah, it was a custom transaction item option, not a custom transaction line field; I haven’t tried that. I don’t have time to try this out today but I would circle back to what I said earlier: this is not a supported use case.
s
I understood. But would it be hard to remove that 'other parameters are ignored' line from the doc? Thanks
s
I can ask for it to be clarified; I’m still a little confused as to what code you were using in conjunction with this method to set a transaction line field
s
I'm using the same code snippet that you tried previously with a small difference where I am trying to update a custom transaction line field while you're updating a custom transaction item option field.
s
My question was more about how you were setting the custom transaction line field – are you using options : cartOptionId?
s
Here is the code snippet.
Copy code
this.application.getComponent('Cart').updateLine({
							line: {
								internalid: 'item1109set11'
							,	quantity: 1
							,	options: [
									{
										"cartOptionId": "custcol_ag_special_instrcut"
									,	"value": {"internalid": "Test", "label": "Test"}
									}
								]
							}
						})
						.catch(function(error){
							console.warn(error);
						})
👍🏻 1
s
Did you type that example out now or is that your real code? I ask because there’s a comma missing in your options object and possibly a typo on the field name
s
Sorry. Yes, I just copied it from the real code and inserted some static values where I missed the comma as you mentioned.