Vishal Chaudhari
03/19/2025, 4:05 PMCeligo AI
03/19/2025, 4:05 PMAI generated answer (using internal Slack threads):To update the price level of an item under Sales/Pricing using a script, you can use SuiteScript's
record
module to load the item record, set the new price level, and then save the record. Here is a sample code snippet:
javascript
/**
*@NApiVersion 2.x
*@NScriptType Suitelet
*/
define(['N/record'], function(record) {
function onRequest(context) {
var itemId = 123; // replace with your item's internal id
var newPriceLevel = 4; // replace with your new price level's internal id
var itemRecord = record.load({
type: record.Type.INVENTORY_ITEM, // or the appropriate item type
id: itemId
});
itemRecord.setValue({
fieldId: 'pricelevel',
value: newPriceLevel
});
itemRecord.save();
}
return {
onRequest: onRequest
};
});
This script loads the item record, sets the new price level, and then saves the record. Replace 123
with the internal ID of the item you want to update, and 4
with the internal ID of the new price level.
Please note that this script is a Suitelet, but you can adapt it to other script types as needed. Also, make sure to replace record.Type.INVENTORY_ITEM
with the appropriate item type if you're not updating an inventory item.
******
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
03/19/2025, 4:05 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859012
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856172323
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.855745912
Celigo AI
03/19/2025, 4:05 PM