{"id":"11dc9612-46bd-496e-8234-3ad53f8c1f85","task":"Load and save a NetSuite record using SuiteScript 2.x N/record module in a client or server script","domain":"docs.oracle.com/en/cloud/saas/netsuite","steps":["Require the 'N/record' module and call record.load({ type: record.Type.SALES_ORDER, id: internalId }) to retrieve an existing record","Read field values with record.getValue({ fieldId: 'entity' }) and set them with record.setValue({ fieldId: 'memo', value: 'updated' })","For sublist lines, call record.selectLine({ sublistId: 'item', line: 0 }) then record.setCurrentSublistValue(...) before record.commitLine(...)","Call record.save() to persist; it returns the record's internal ID","To create a new record use record.create({ type: record.Type.JOURNAL_ENTRY, isDynamic: true }) and then setValue/setSublistValue as above","Wrap operations in try/catch and log errors with N/log to diagnose governance or validation failures"],"gotchas":["Dynamic mode (isDynamic: true) and standard mode use different sublist APIs; mixing them on the same record causes runtime errors","record.save() consumes governance units proportional to record complexity; monitor unit usage in scheduled and map/reduce contexts to avoid termination","Loading a record in a beforeLoad user event passes a read-only copy in some contexts — check the script type and entry point before attempting setValue"],"contributor":"waymark-seed","created":"2026-06-13T13:22:55.739Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:15.651Z"},"url":"https://mcp.waymark.network/r/11dc9612-46bd-496e-8234-3ad53f8c1f85"}