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/Custom GL Plug-in Part 2 โ€” Real Audit & Compliance Reporting Examples

Custom GL Plug-in Part 2 โ€” Real Audit & Compliance Reporting Examples

๐Ÿงฉ Custom GL Plug-in Part 2 โ€” Real Audit and Compliance Reporting Examples

Introduction

In regulated accounting environments, transparency is everything.
The Custom GL Lines Plug-in allows organizations to control how transactions hit the general ledger โ€” but auditors also need to see why and how those entries were generated.

In this tutorial, youโ€™ll learn how to:
โœ… Create auditable GL adjustments.
โœ… Generate reconciliation reports for auditors.
โœ… Use custom records to log plug-in activity.
โœ… Apply allocation logic for compliance and traceability.


๐Ÿ’ก Why Audit Visibility Matters

ObjectiveExample
ComplianceSOX / IFRS reporting requires traceable entries
AccuracySplit revenue by project or region
TransparencyShow why a GL line was added
Audit TrailRecord who and which script generated entries

โš™๏ธ Design Pattern Overview

  1. Custom GL Plug-in adds extra lines.
  2. Custom Record logs each adjustment (custrecord_gl_audit_log).
  3. Saved Search / SuiteAnalytics Workbook aggregates entries for auditors.

๐Ÿงฑ Step 1: Extend the Custom GL Plug-in

/**
 * @NApiVersion 2.1
 * @NScriptType CustomGLPlugin
 */
define(['N/record','N/log'], (record, log) => {
    function customizeGlImpact(context) {
        try {
            const rec = context.transactionRecord;
            const total = rec.getValue('total');
            const dept = rec.getValue('department');

            if (total > 5000) {
                const newLine = context.customLines.addNewLine();
                newLine.setAccountId(2345);        // Audit adjustment account
                newLine.setDebitAmount(25);
                newLine.setMemo('Compliance Adjustment Fee');

                // Log to custom audit record
                const audit = record.create({ type: 'customrecord_gl_audit_log' });
                audit.setValue('custrecord_source_tran', rec.id);
                audit.setValue('custrecord_adjustment_amount', 25);
                audit.setValue('custrecord_created_by', runtime.getCurrentUser().id);
                audit.save();
            }
        } catch (e) { log.error('Audit Plug-in Error', e); }
    }
    return { customizeGlImpact };
});

โœ… Result: Each time a qualifying transaction posts, a GL adjustment line is added and a matching audit record is stored.


๐Ÿงฎ Step 2: Create Audit Log Custom Record

FieldIDType
Source Transactioncustrecord_source_tranList/Record (Transactions)
Adjustment Amountcustrecord_adjustment_amountCurrency
Created Bycustrecord_created_byEmployee
Timestampcustrecord_created_onDate/Time (Auto)
Statuscustrecord_audit_statusList (Pending, Posted, Reviewed)

Add permissions so only Accounting and Auditors can view or edit these records.


๐Ÿ“Š Step 3: Create Audit Reports and Searches

Saved Search: Custom GL Adjustments โ€“ Audit Trail

  • Type: Custom Record > GL Audit Log
  • Columns: Transaction, Account, Amount, Created By, Date
  • Filter: Created Date within this fiscal period
  • Highlight abnormal entries (> threshold).

Example Formula Column: CASE WHEN {custrecord_adjustment_amount} > 1000 THEN 'โš  Review' ELSE 'OK' END


๐Ÿ“ˆ Step 4: Generate Audit Reports via SuiteAnalytics Workbook

  1. Create Dataset โ†’ Base = Custom GL Audit Log.
  2. Join to Transaction and Employee.
  3. Add Pivot: Amount by Department / Month.
  4. Add Chart: Bar Graph of Adjustment Totals by User.

๐Ÿ“Š Result: Auditors see summary of who posted manual GL adjustments and why.


๐Ÿ“š Step 5: Integrate with Approval Workflow (Optional)

For compliance, you can require CFO approval before posting manual entries.

Workflow Condition: If Amount > 1000 โ†’ Set Status = Pending CFO Review
Add buttons โ€œApproveโ€ and โ€œRejectโ€ on the Custom Record form.


๐Ÿง  Advanced Audit Use Cases

Use CaseDescription
Revenue Split AuditTrack allocation of revenue between multiple departments automatically.
Tax Adjustment TrackingLog custom tax GL entries for VAT/GST reconciliation.
Intercompany AllocationsGenerate balancing entries across subsidiaries.
Deferred Revenue ComplianceCreate GL adjustments for ASC 606 rules and log details.

๐Ÿ” Example: Intercompany Allocation Plug-in Logic

if (subsidiaryA !== subsidiaryB) {
    const intercoLine = context.customLines.addNewLine();
    intercoLine.setAccountId(5678);
    intercoLine.setCreditAmount(100);
    intercoLine.setMemo('Intercompany Adjustment');
    logAudit(subsidiaryA, subsidiaryB, 100);
}

This records both the GL entry and a matching audit log entry for financial review.


๐Ÿงพ Step 6: Exporting Audit Data for External Review

  • Use CSV Export or SuiteAnalytics Workbook to share audit trail with auditors.
  • Create role External Auditor (Read-Only) with access only to Audit Records and GL Reports.
  • Schedule export monthly via SuiteAnalytics Scheduled Workbook Email.

โšก Common Audit Mistakes and Fixes

ProblemRoot CauseFix
No trace of manual GL linePlug-in adds line but no record loggedCreate custom record per entry
Audit report incompleteFilters exclude inactive usersInclude All Employees in search
Auditor canโ€™t see logsPermission issueAssign โ€œViewโ€ access to role
Incorrect account IDsHardcoded IDs mismatch across envUse script parameter or lookup table

๐Ÿงฉ Security Best Practices

โœ… Store Audit Data in Custom Records, not transaction memos.
โœ… Restrict access to Accounting and Auditors roles only.
โœ… Encrypt sensitive references (if PII exists).
โœ… Never allow users to edit audit records after posting.
โœ… Enable System Notes v2 for change tracking.


๐Ÿ“š Related Tutorials

  • ๐Ÿ‘‰ Custom GL Lines Plug-in (Part 1)
  • ๐Ÿ‘‰ SuiteScript Security & Governance Best Practices
  • ๐Ÿ‘‰ Advanced Approval Workflows in NetSuite

โ“ FAQ

Q1. Can auditors view GL impact directly in NetSuite?
Yes โ€” if they have the โ€œGeneral Ledger Viewโ€ permission and access to Audit Records.

Q2. Can Custom GL Plug-ins affect system posting order?
No โ€” they run after standard GL impact is created but before posting.

Q3. Can I build a dashboard to monitor audit entries?
Yes โ€” create a Custom Portlet that shows recent audit adjustments or total adjustments per month.

Q4. Is there a limit to number of audit entries?
No practical limit โ€” but archive old records annually for performance.


๐Ÿงญ Summary

The Custom GL Plug-in is not just about automation โ€” itโ€™s a foundation for audit readiness and transparency.
By logging every GL impact and building analytics around it, your NetSuite system can produce traceable, compliant, and easily auditable financial data.

This approach transforms your accounting customization into a governance-aligned, CFO-approved solution โ€” ready for real-world enterprise audits.

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