Shelby Owens
10/01/2024, 2:26 PMCeligo AI
10/01/2024, 2:26 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** The error you're encountering is due to the fact that NetSuite does not allow updating the purchase price directly on the vendor sublist. Instead, the purchase price is represented by a subrecord. Here's how you can update the purchase price: 1. Select the line you want to update using
selectLine()
.
2. Get the subrecord using getCurrentSublistSubrecord()
.
3. Update the price on the subrecord.
Here's a code snippet that demonstrates this:
javascript
itemRecord.selectLine({
sublistId: 'itemvendor',
line: i
});
var vendorSubrecord = itemRecord.getCurrentSublistSubrecord({
sublistId: 'itemvendor',
fieldId: 'itemvendorprice'
});
vendorSubrecord.setValue({
fieldId: 'vendorprice',
value: tradePrice
});
itemRecord.commitLine({ sublistId: 'itemvendor' });
In this code snippet, itemvendor
is the sublistId for the vendor sublist, i
is the line number you want to update, and tradePrice
is the new purchase price.
Please note that the purchase price is on the itemvendorpricelines
sublist of the subrecord, with each line representing a different currency. You may need to iterate over this sublist to find the line with the correct currency before updating the price.
Remember to save the record after making these changes.Celigo AI
10/01/2024, 2:26 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856624544
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856004715
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85497117
Celigo AI
10/01/2024, 2:26 PM