RE: Fetch currencies using Suite Script 2.0

Things I want to do:

  1. I want to add currencies in Financial subtab when new customer / client gets created based on its Primary currencies.
  2. How should i fetch the currencies which are actually stored in NetSuite ->List->Accounting-> Currencies.
  3. And base on that currencies I need to append rest of the currencies excluding the default to customer record.
 function beforeSubmit(context) {
            var tgType = context.type;
            if(tgType == ‘create’) {
            var rec = context.newRecord;
            log.debug({title: ‘Record Type ‘, details: context.newRecord.type });
          const currencies = [‘CAD’,’EUR’,’USD’,’GBP’];
         // var currencies = [3,4,2,1];
            var cur = rec.getValue({
                fieldId: ‘currency’,
             var custCurrencyLines = rec.getLineCount({
            sublistId: “currency”
          var cnt = 0;
            for (var key in currencies) {
                if (currencies[key] && cnt <=2) {
                    sublistId: “currency”,
                    line: cnt
                    log.debug(“Count is”,cnt);
                    sublistId: “currency”,
                    fieldId: “currency”,
                    line: cnt,
                    text: currencies[key]
        return {
            beforeSubmit: beforeSubmit

I want to fetch the currencies from NetSuite using suite script 2.0.

Pushpak Rookie Asked on February 24, 2023 in SuiteScript.
Add Comment
2 Answers


You can search for currencies using the N/search module.

   type: search.Type.CURRENCY,
   columns: ['internalid', 'name', 'symbol']



Intermediate Answered on February 24, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.