title: NetSuite: Issue turning a quote into a sales order
body: <p>I have two business requirements that are currently conflicting with each other. I added the following logic to the client-side order creation code, to restrict who could order by invoice:</p>
  
  <pre><code>if (type == 'create' &amp;&amp; nlapiGetContext().getRoleCenter() == 'CUSTOMER') {
      if(nlapiGetFieldValue('entity')){// shouldn't be here if no entity
          var hasTerms = nlapiLookupField('customer', nlapiGetFieldValue('entity'), 'terms');
          var neededFormId = hasTerms ? 135 : 134;
          if (req &amp;&amp; !req.getParameter('cf') &amp;&amp; neededFormId != nlapiGetFieldValue('customform')) {
              nlapiSetRedirectURL('RECORD', nlapiGetRecordType(), nlapiGetRecordId(), (type == 'create'), { cf: neededFormId });
          }
      }
  }
  </code></pre>
  
  <p>However, for some reason, this has now broken the following needed use case: When I now click "Create Order" from a Quote, it creates it but with none of the items from the quote in the order any more. When I comment out the above logic , the "Create Order" button works fine. How can I get both? Can I somehow check if the order is being created as a result of an existing quote or not?</p>