StandardLine

getEntityId()

Example 1: Loading the Record

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
         var recType = transactionRecord.getRecordType();
         if (recType == 'salesorder') 
         {
            var custRecord = nlapiLoadRecord('customer',currLine.getEntityId());
            // get record properties here
            ...
         }
      ...
      }
   } 

        

Example 2: Searching for the Record

             // utility function
   function searchNeededPropertiesOfCustomer(customerId)
   {
      var searchFilters = new Array();
      searchFilters[0] = new nlobjSearchFilter('internalid', null, 'anyof', customerId);
      var savedSearchResults = nlapiSearchRecord('customer', 'customsearch_script_id', searchFilters);
  
      if (savedSearchResults != null && savedSearchResults.length > 0)
      {
         return savedSearchResults[0];
      }  
      return null;
   }

   function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      for (var i = 0; i < standardLines.getCount(); i++)
      {
         var currLine = standardLines.getLine(i);
         var recType = transactionRecord.getRecordType();
         if (recType == 'salesorder')
         {
         // nlobjSearchResult
         var custMap = searchNeededPropertiesOfCustomer(currLine.getEntityId());
         // get search columns here
         ...
         }
         ...
      }
   } 

        

getId()

Example

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
         if (currLine.getId() == 0)
         {
            // it's a summary line
         }
      ...
      }
   } 

        

getSubsidiaryId()

Example

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
         var subId = currLine.getSubsidiaryId();
         ...
         var subRecord = nlapiLoadRecord('subsidiary',subId,'');
         ...
         }
      ...
      }
   } 

        

getTaxableAmount()

Example

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
         // check tax
         if (currLine.getTaxItemId() != -7) // taxable transaction
         {
            var taxType = currLine.getTaxType();
            if (taxType == "US_ST") 
            {
               // process state taxes
               var taxAmt = currLine.getTaxAmount();
               var taxableAmt = currLine.getTaxableAmount(); 
               ...
            }
         }
      ...
      }
   } 

        

getTaxAmount()

Example

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
         // check tax
         if (currLine.getTaxItemId() != -7) // taxable transaction
         {
            var taxType = currLine.getTaxType();
            if (taxType == "US_ST") 
            {
               // process state taxes
               var taxAmt = currLine.getTaxAmount();
               var taxableAmt = currLine.getTaxableAmount(); 
               ...
            }
         }
      ...
      }
   } 

        

getTaxItemId()

Example

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
         // check tax
         if (currLine.getTaxItemId() != -7) // taxable transaction
         {
            var taxType = currLine.getTaxType();
            if (taxType == "US_ST") 
            {
               // process state taxes
               var taxAmt = currLine.getTaxAmount();
               var taxableAmt = currLine.getTaxableAmount(); 
               ...
            }
         }
      ...
      }
   } 

        

getTaxType()

Example

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
         // check tax
         if (currLine.getTaxItemId() != -7) // taxable transaction
         {
            var taxType = currLine.getTaxType();
            if (taxType == "US_ST") 
            {
               // process state taxes
               var taxAmt = currLine.getTaxAmount();
               var taxableAmt = currLine.getTaxableAmount(); 
               ...
            }
         }
      ...
      }
   } 

        

isPosting()

Example

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      // find all posting lines
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
            if (currLine.isPosting()) 
            {
               // process standard line here
            }
      }
      ...
   } 

        

isTaxable()

Example

             function customizeGlImpact(transactionRecord, standardLines, customLines, book)
   {
      ...
      // find all taxable lines
      for (var i = 0; i < standardLines.getCount(); i++) 
      {
         var currLine = standardLines.getLine(i);
            if (currLine.isTaxable()) 
            {
               // process tax here
            }
      }
      ...
   } 

        

Related Topics

customizeGlImpact(transactionRecord, standardLines, customLines, book)
StandardLines

General Notices