ANS-1933 · SUITESCRIPT DEVELOPMENT
Can You Load NetSuite Records with ‘View’ Permissions in SuiteScript?
Records can be loaded with 'View' permission in SuiteScript, but saving requires edit access.
Short answer
Yes, records can be loaded using N/record.load in SuiteScript 2.x with 'View' permission. However, saving or submitting changes via N/record.save will fail due to insufficient permissions, as 'View' access does not grant modification rights. Edit or higher permissions are required for saving.
Scenario
A user is attempting to interact with NetSuite records via SuiteScript. The user's role has been granted 'View' permission for a specific record type, such as a Service Item. The objective is to understand if a script can successfully retrieve record data and if it can then modify and save that data under these permission constraints.
Solution
When a user's role has only 'View' permission for a specific record type, the following behavior is observed in SuiteScript 2.x:
Loading a record: A script can successfully load a record using the N/record.load function. This operation retrieves all accessible field data for the record.
javascript
var recordId = 123; // Example record ID
var recordType = 'serviceitem'; // Example record type
var loadedRecord = record.load({
type: recordType,
id: recordId,
isDynamic: true // or false, depending on script needs
});
// The record object will be successfully populated.Submitting a record: Attempting to save or submit any changes to the loaded record using the N/record.save function will result in a permission error. 'View' permission explicitly restricts modification or creation of records.
javascript
// Assuming 'loadedRecord' was obtained with 'View' permission
loadedRecord.setValue({
fieldId: 'memo',
value: 'Updated memo'
});
// This operation will fail with a permission error
loadedRecord.save();This behavior was tested and confirmed with 'View' permission granted for an Item record type (e.g., Service Item).
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
