Aaron McCausland
01/13/2025, 10:02 PMInventory Revaluation is no longer the first transaction in the item's history
Celigo AI
01/13/2025, 10:02 PMAI generated answer (using internal Slack threads):The error message
Inventory Revaluation is no longer the first transaction in the item's history
typically occurs when you're trying to perform an Inventory Adjustment on an item that has already had transactions against it.
NetSuite requires that the first transaction for an item be an Inventory Revaluation if you're using the Average Costing method. This is to establish the initial cost of the item. Any subsequent transactions (like sales, purchases, or adjustments) will then adjust this cost.
To resolve this issue, you have a couple of options:
1. Create a new item: This is the simplest solution. You can create a new item and start with an Inventory Revaluation as the first transaction. However, this might not be feasible if the item has a significant transaction history that you need to maintain.
2. Zero out the item's inventory: If you have a window in your transaction history where there are no transactions for the item, you can adjust the item's inventory to zero, and then perform an Inventory Revaluation. This effectively resets the item's cost history. However, this will impact your financials for the period, so you'll need to use an appropriate expense account or a holding account for the inventory adjustments.
In your SuiteScript code, you'll need to create an Inventory Adjustment record and set the necessary fields (like subsidiary
, account
, item
, location
, adjustqtyby
, etc.). Make sure all the accounts are set correctly, especially on the item. Sometimes, the UI defaults values for an account while a script will not, which can lead to errors.
Here's a simplified example of how you might create an Inventory Adjustment record in SuiteScript:
javascript
const adjustmentRecord = record.create({
type: record.Type.INVENTORY_ADJUSTMENT,
isDynamic: false
});
adjustmentRecord.setValue({
fieldId: 'subsidiary',
value: 1
});
adjustmentRecord.setValue({
fieldId: 'account',
value: 1242
});
adjustmentRecord.insertLine({
sublistId: 'inventory',
line: 0
});
adjustmentRecord.setSublistValue({
sublistId: 'inventory',
fieldId: 'item',
value: 276221,
line: 0
});
adjustmentRecord.setSublistValue({
sublistId: 'inventory',
fieldId: 'adjustqtyby',
value: catalogQuantity,
line: 0
});
adjustmentRecord.save();
******
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
01/13/2025, 10:03 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826783478
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.822839856
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.822826
Celigo AI
01/13/2025, 10:03 PM