title: https.post.promise “.then” not called
body: <p>Hello – I hope someone could provide some advise or feedback.</p>
  <p><strong>Summary:</strong> I am trying to create a custom button (UE script) on Sales Order record. That custom button executes a function from a client side script. The function (snippet below) uses <strong>https.post.promise.</strong> It calls a Suitelet that I will be using to process some backend logic.</p>
  <p><strong>Problem:</strong> The <em>“.then”</em> portion is not called/executed.</p>
  <p><strong>Notes:</strong></p>
  <ul>
  <li>Everything is working <strong>expect</strong> for <em>.then</em> part. The suitelet is called by the post</li>
  <li>When I tried to call the same function on pageInit, the <em>.then</em> part is executing</li>
  <li>I have used chrome’s javascript profiler as well and tried to compare both executions (by clicking button and pageInit). I can see that <em>.then</em> is being called when the snippet is executed via pageInit but is not executed, when clicking the button</li>
  </ul>
  <pre class="lang-js prettyprint-override"><code>    function createIntercoPo(soId){
          
          log.debug('CS - Create Interco PO', 'START ' + soId);
          
          var suiteletURL = url.resolveScript({
              scriptId: 'customscript_swx_sl_auto_ic_so_po',
              deploymentId: 'customdeploy_swx_sl_auto_ic_so_po',
          });
  
          log.debug('CS - Suitelet URL', suiteletURL);
          
          /*https.post({
              async: true,
              url: suiteletURL,
              body: {
                  soId: soId
              },
              callback: function(response) {
                  
                  
                  var result = JSON.parse(response.body);
                  redirectAfterProcess(result, transId, transType, &quot;generation&quot;);
              }
          });*/
                  
          https.post.promise({
              url: suiteletURL,
              body: {
                  soId: soId
              } 
          })
          .then(function (response){
              log.debug({
                  title: 'Response',
                  details: response
              });
              
              //redirectAfterProcess(soId);
              
              log.debug('CS - Inside Promise', 'Test');
          })
          .catch(function onRejected(reason) {
              log.debug({
                  title: 'Invalid Request: ',
                  details: reason
              });
          });
          
          log.debug('CS - Create Interco PO', 'END');
          
      }
  </code></pre>