title: Netsuite: How to debug workflow action script
body: <p>I'm new on suitescript(Javascript based used in Netsuite custumization).
  I have a workflow action script and  want to debug it via Scritp Debugger in Netsuite.But  I couldnt see my workflow action script in Debugger, even if I invoked the custom action.</p>
  
  <p>I use Eclipse IDE and upload my file to Netsuite. Here is my code, simply it just adds expense report  info note to employee when the empolyee expense report is created.  It has a problem with returning type.</p>
  
  <pre><code>function UpdateEmployeeWithExpenseReport()
  {
     var stFrequentCriteria = nlapiGetContext().getSetting('SCRIPT',
          'custscript_oradata_freq_trav_limit');  // get value of the script parameter
     var intFrequentCriteria = parseInt(stFrequentCriteria); //the limit of frequency
     var recExpenseReport = nlapiGetNewRecord();
     var stEntity = recExpenseReport.getFieldValue('entity');  
     var today = new Date();
     var aMonthAgo = nlapiAddDays(today, -30); 
     // filter just the main lines of expenses
     var arrSearchFilters =  [
          new nlobjSearchFilter('employee', null, 'is', stEntity),
          new nlobjSearchFilter('trandate', null, 'within', aMonthAgo, today),
          new nlobjSearchFilter('mainline', null, 'is', 'T') ];                                                   
     var arrSearchColumns = [ new nlobjSearchColumn('internalid', null, 'count') ]; // Note: count is not a field, it just counts internal id based on  Empolyee expenses reports
     var arrSearchResults = nlapiSearchRecord('expensereport', null,
          arrSearchFilters, arrSearchColumns);
     var stCount = arrSearchResults[0].getValue(arrSearchColumns[0]); //                                                                  
     var count = parseInt(stCount);
     var stFrequentTraveler = '';
     if (count &gt;= intFrequentCriteria)
     {
        stFrequentTraveler = 'Frequent';
     }
     else 
     {
      stFrequentTraveler = 'Infrequent';
     }
  
     var stAmount = recExpenseReport.getFieldValue('amount');
     var intExpenseLines = recExpenseReport.getLineItemCount('expense');
     var stNotes = '';
     stNotes += stFrequentTraveler + 'Traveler' + '\n';
     stNotes += 'Last Expense Report' + '\n';
     stNotes += '--Expense Report Total= ' + stAmount + '\n';
     stNotes += '--Expense Lines = ' + intExpenseLines;
  
     var recEmployee = nlapiLoadRecord('employee', stEntity); // 1 internal name of record, 2.internal id for the  record
  
     recEmployee.setFieldValue('comments', stNotes);
     nlapiLogExecution('tDEBUG', 'stEntity', stEntity);
     stEntity = recEmployee.getFieldValue('entityid');
  </code></pre>