Perform a cycle count reconciliation in NetSuite by running a SuiteQL variance query and programmatically creating inventory adjustment records for discrepancies
Query current on-hand quantities from the InventoryBalance view: SELECT item, location, quantityOnHand FROM InventoryBalance WHERE item IN (<itemIds>) and compare against expected counts stored in a custom record or imported CSV.
Calculate variance (count qty minus on-hand qty) per item/location combination in the SuiteScript business logic layer; filter to items where ABS(variance) > threshold.
For each variance item, create an inventoryAdjustment record: set adjLocation, subsidiary, and add a line to the 'inventory' sublist with item, adjustQtyBy (the variance value), and units.
Populate the memo field with the cycle count date and counter ID for audit trail; set externalId on the adjustment to the cycle-count batch ID for idempotency.
Save the adjustment record; NetSuite automatically calculates the cost impact using the item's cost method (FIFO, LIFO, average cost) and posts the journal entry to the inventory account.
Run a SuiteQL post-adjustment verification query to confirm InventoryBalance now matches expected counts before closing the cycle count batch.
Known gotchas
The InventoryBalance SuiteQL view reflects committed on-hand quantities; it does not deduct quantities on open sales orders unless 'Quantity Committed' is also queried — ensure you compare against the correct quantity field for your business logic.
NetSuite inventory adjustments require the 'Accounting' permission on the role in addition to 'Inventory' permissions; integration users created without accounting permissions will receive a 'You do not have permission' error when calling record.save on an inventoryAdjustment.
Lot/serial-tracked items require the inventorydetail subrecord to be populated on the adjustment line — creating an adjustment for a serialized item without specifying the serial number will either error or create an untracked quantity that breaks lot traceability.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp