Andrew Luke
09/27/2024, 9:14 PMCeligo AI
09/27/2024, 9:14 PMAI generated answer (using internal Slack threads):To update a matrix item with SuiteScript, you can use the
record.submitFields
method or record.load
method followed by record.save
. However, it's important to note that there are certain limitations and complexities when dealing with matrix items in SuiteScript.
Here's a sample code snippet for updating a matrix item:
javascript
var itemId = 123; // replace with your item's internal id
var record = record.load({
type: record.Type.INVENTORY_ITEM,
id: itemId
});
record.setValue({
fieldId: 'custitem_some_custom_field',
value: 'New Value'
});
record.save();
In the case of setting the price for a matrix item, you would need to use the record.setSublistValue
method. The sublistId and fieldId would depend on the features enabled in your account (like multicurrency, multi quantity, etc.). Here's a sample code snippet:
javascript
var itemId = 123; // replace with your item's internal id
var record = record.load({
type: record.Type.INVENTORY_ITEM,
id: itemId
});
record.setSublistValue({
sublistId: 'price1',
fieldId: 'price',
line: 0,
value: 100
});
record.save();
Remember to replace 'price1' and 'price' with the correct sublistId and fieldId for your account. You can find these in the NetSuite Help Center under the 'Pricing Sublist / Pricing Matrix' section.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
09/27/2024, 9:15 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821645141
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816100955
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811111212
Celigo AI
09/27/2024, 9:15 PM