Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

295
Views
Accessing NetSuite modules from Config file scripts (SuiteScript)

I am trying to build a JS file to place in the file cabinet to reference my most used functions I constantly rebuild. I have been able to access it by placing the script in the file cabinet and using the @NAmdConfig to reference the functions. However, I cannot access the NetSuite modules in these scripts. I cut most of the function off in my example, but if I can return that to my original Map/Reduce script that will suffice. How can I have a third party script of my most used functions while still having access to the NetSuite modules?

/**
 * @NApiVersion 2.1
 * @NModuleScope public
 */

        var MattsFunctions = {
            dynamicTransactionSearch:
                function (sentId) {
                    var thisRecord = record.load({
                        type: record.Type.SALES_ORDER,
                        id: sentId
                    })
                    return thisRecord.id

            }
        }

I have also tried

/**
 * @NApiVersion 2.1
 * @NModuleScope public
 */


define(['N/search', 'N/record'],

    (search, record) => {

        var exports = {};
        var MattsFunctions = {
            dynamicTransactionSearch:
                function (sentId) {
                    var thisRecord = record.load({
                        type: record.Type.SALES_ORDER,
                        id: sentId
                    })
                    return thisRecord.id

                }

        }
        exports.MattsFunctions = MattsFunctions
        return exports

    })

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Figured it out. Simply pass the module over in the function you're calling, of course!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!