title: How do we get the record type in UserEvent SuiteScript 2.0
body: <p>How do we get the record type in UserEvent SuiteScript 2.0 ?</p>
  
  <p>I want to deploy my SuiteScript for more than 1 record type (Customer Payment, Credit Memo, Deposit, Invoice)</p>
  
  <p>Now in my SuiteScript I need to identify the record type and do actions based on it.</p>
  
  <p>My code:</p>
  
  <pre><code>define(['N/record', 'N/https'],
  function(record,https)
  {
      function afterSubmit(context)
      {
          var myUrl = 'My url here';
  
          var rType = context.newRecord.Type;
          log.debug({title: 'rType1 ', details: rType });
          //This returns nothing
  
          rType = record.Type;
          log.debug({title: 'rType2 ', details: rType });
          //This gives all the available record types in Netsuite
  
          var JsonPayload = 'need to know whether its an invoice or a payment here';
          log.debug({title: 'payload ', details: JsonPayload });
  
          var response = https.post({ url: myUrl, body: JsonPayload});
          log.debug({title: 'response ', details: response });
      }
  }
  return {
      afterSubmit: afterSubmit
  };
  
  });
  </code></pre>