Base Currency from Accounting Book Record

Depending on the transaction type, you can get the base currency from the transaction record. For example, a Cash Sale record contains information about the accounting book and the associated base currency for the transaction:

Base currency in the transaction record.

Use the following example code to find the base currency for the current accounting book using the Record object:

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      var bookId = book.getId();
      var baseCurrency;
      
      for (var line = 1; line <= transactionRecord.getLineItemCount('accountingbookdetail'); line++) 
      {
         if (bookId == transactionRecord.getLineItemValue('accountingbookdetail','bookid',line))
         {            
            baseCurrency = transactionRecord.getLineItemValue('accountingbookdetail','currency',line);    
            
            break;
         }
      }
      ...
   } 

        

Related Topics

Multiple Currencies Examples
Find the Base Currency
Transaction-Specific Exchange Rates
Convert Currencies with SuiteScript

General Notices