Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The NetSuite Pro

The NetSuite Pro Logo The NetSuite Pro Logo

The NetSuite Pro Navigation

  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us
Home/ NetSuite Customization Guide: Fields, Forms, Workflows & Scripts/Managing Custom Roles & Permissions for Custom Records and Scripts in NetSuite

Managing Custom Roles & Permissions for Custom Records and Scripts in NetSuite

🔐 Managing Roles & Permissions for Custom Records and Scripts in NetSuite

Introduction

NetSuite’s flexibility comes with responsibility — controlling who can see, edit, and execute what.
Properly managing roles and permissions ensures your users have the right level of access while protecting sensitive financial data, scripts, and custom records.

In this tutorial, we’ll cover how to:

  • Set up and customize roles
  • Secure custom records and SuiteScripts
  • Manage field-level and workflow access
  • Troubleshoot permission errors (like “You do not have permission to access this record”)

💡 Why Role Management Matters

BenefitDescription
Data SecurityPrevent unauthorized data access
Operational ControlLimit who can create or approve transactions
ComplianceEnforce SOX, GDPR, or internal audit rules
Script SafetyControl which users can run automation scripts
PerformanceReduce risk of accidental bulk edits or mass updates

🧱 Understanding NetSuite Role Structure

Roles determine what records, pages, and actions a user can access.

Each role is made up of:

  • Permissions (Record, Transaction, Setup, Lists)
  • Access Levels (View, Create, Edit, Full)
  • Restrictions (Subsidiary, Department, Class)
  • Script and Workflow Executions

Default vs Custom Roles

TypeDescriptionUse Case
Standard RolesProvided by NetSuite (e.g., Administrator, Accountant)Quick start
Customized Standard RoleCopy of a standard role with modificationsMost common
Fully Custom RoleBuilt from scratchComplex security setup

⚙️ Step-by-Step: Creating a Custom Role

Step 1: Navigate to Role Setup

Go to:
Setup → Users/Roles → Manage Roles → New

Step 2: Define Basic Info

FieldExample
Name“Custom Record Manager”
Center TypeAccounting, Sales, or All
Subsidiary Restriction“Own + Child”
Two-Factor AuthenticationOptional (Recommended)

Step 3: Add Permissions

a. Record Permissions

Add:

  • Custom Record: Full
  • Transactions: View/Edit as needed
  • Lists → Employees, Customers, Vendors: View

b. Setup Permissions

Add:

  • Script Deployment: View or Edit (for developers)
  • Custom Record Types: Edit
  • Workflow Management: Full (if creating workflows)

c. Lists Permissions

Include access to lists related to the record (Items, Subsidiaries, Departments).


Step 4: Assign Role to Employee

Go to:
Lists → Employees → Employees → Edit Employee → Access Tab
Add Role → Custom Record Manager
✅ Save.


🧩 Restricting Access to Custom Records

Each Custom Record Type in NetSuite has its own access controls.

Step 1: Edit the Custom Record

Go to:
Customization → Lists, Records, & Fields → Record Types → Edit

Step 2: Set Access Type

Choose between:

  • Use Permission List
  • Use Role List
  • Use Owner Restriction

Step 3: Grant Access

RolePermissionLevel
Custom Record ManagerFullEdit/Delete
Sales RepView OnlyRead
AdminFullAll access

Step 4: Enable “Allow UI Access”

If unchecked, records can only be accessed via script — not from the UI.


🧠 Field-Level Permissions

NetSuite does not have built-in field-level security, but you can simulate it using:

  1. Workflows → Hide/Disable fields based on role or status.
  2. Client Scripts → Dynamically disable or hide fields on form load.

Example (Client Script):

/**
 * @NApiVersion 2.1
 * @NScriptType ClientScript
 */
define(['N/runtime'], (runtime) => {
    function pageInit() {
        const userRole = runtime.getCurrentUser().role;
        if (userRole !== 3) { // Role ID 3 = Administrator
            document.getElementById('custbody_sensitive_field').disabled = true;
        }
    }
    return { pageInit };
});

✅ This hides or locks fields for non-admin users.


⚡ Securing Script Deployments

Each Script Deployment can be limited to specific roles and audiences.

Steps:

  1. Go to: Customization → Scripting → Script Deployments → Edit
  2. Under Audience tab, select:
    • Specific Roles (e.g., Accountant, Admin)
    • Departments, Subsidiaries, Employees
  3. Save deployment.

🔐 Tip: Avoid deploying scripts to All Roles unless necessary.


🔄 Workflow Role Permissions

Workflows also respect role-based restrictions:

  • In each State Action, you can set “Execute As Role”.
  • Only that role will perform the action, regardless of who triggers it.
  • Use Custom Fields (Approver Role) to dynamically route records.

🧮 Example: Role-Specific Approval Workflow

Scenario:
Only Managers can approve Purchase Orders.

Setup:

  • Create role: Purchase Order Approver
  • Workflow condition:
    If {currentRole} = Purchase Order Approver → Show Approve Button
  • Other users only see Pending state.

🧰 Troubleshooting Permission Errors

ErrorReasonFix
“You do not have permission to access this record.”Record type not assigned to roleAdd record permission (View/Edit)
“You cannot edit this field.”Workflow or client script restrictionCheck logic or field UI access
“Script execution failed for user.”Missing deployment audienceAdd user role to deployment
“Record type undefined.”Custom Record hidden from UIEnable “Allow UI Access”

🧠 Best Practices for Role & Permission Setup

✅ DO:

  • Use least privilege principle (only what’s needed).
  • Group roles by function, not by person.
  • Document all role changes (audit log).
  • Test roles in Sandbox before production.
  • Use Saved Searches for permission audits.

❌ DON’T:

  • Assign Administrator roles broadly.
  • Give Full Access unless absolutely necessary.
  • Overlap approval and transaction edit permissions in one role.

🧮 Advanced: Script-Based Role Validation

You can restrict script execution with role checks:

define(['N/runtime', 'N/error'], (runtime, error) => {
    function execute(context) {
        const roleId = runtime.getCurrentUser().role;
        if (roleId !== 3) {
            throw error.create({
                name: 'PERMISSION_DENIED',
                message: 'You are not authorized to run this process.'
            });
        }
    }
    return { execute };
});

✅ Use this for RESTlets, Suitelets, and Map/Reduce scripts that process sensitive data.


📚 Related Tutorials

  • 👉 Advanced Approval Workflows in NetSuite
  • 👉 Custom GL Plug-in in NetSuite
  • 👉 User Event Scripts for Record Automation

❓ FAQ

Q1. Can I restrict access to specific saved searches?
Yes — under Audience tab on the saved search record.

Q2. Can I prevent users from editing custom records?
Yes — set access level to “View” only in the Custom Record definition.

Q3. Do permissions apply to SuiteScript execution?
Yes — unless scripts use executeAsAdmin.

Q4. Can I log changes to roles or permissions?
Yes — enable System Notes v2 to track changes made to roles and permissions.


🧭 Summary

Controlling roles and permissions is the foundation of secure NetSuite customization.
By managing access at record, script, and workflow level, you can ensure users interact safely with your system — protecting data, automations, and business logic.

A well-designed role structure keeps your NetSuite environment secure, scalable, and audit-ready.

Share
  • Facebook

Leave a ReplyCancel reply

Sidebar

Ask A Question

Stats

  • Questions 6
  • Answers 6
  • Best Answers 0
  • Users 2
  • Popular
  • Answers
  • Rocky

    Issue in running a client script in NetSuite SuiteScript 2.0 ...

    • 1 Answer
  • admin

    How can I send an email with an attachment in ...

    • 1 Answer
  • admin

    How do I avoid SSS_USAGE_LIMIT_EXCEEDED in a Map/Reduce script?

    • 1 Answer
  • admin
    admin added an answer The issue is usually caused by following Wrong script file… September 14, 2025 at 10:33 pm
  • admin
    admin added an answer Steps to send an Invoice PDF by email: define(['N/email', 'N/render',… August 28, 2025 at 3:05 am
  • admin
    admin added an answer This error means your script hit NetSuite’s governance usage limit… August 28, 2025 at 3:02 am

Top Members

Rocky

Rocky

  • 1 Question
  • 22 Points
Begginer
admin

admin

  • 5 Questions
  • 2 Points

Trending Tags

clientscript netsuite scripting suitescript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

© 2025 The NetSuite Pro. All Rights Reserved