title: Pass sdk.rest multiretrieve to a Promise
body: <p>What is wrong with my code?
  privateConfigurationPromise  return always "pending". I have to wait for the multiretrieve result before reading. I can not figure out what is wrong. I also tried with a timer but the answer is always "pending".
  Explain to me what I'm doing wrong.</p>
  
  <pre><code>    function isEmpty(obj) {
              if (obj == null) return true;
  
              if (obj.length &gt; 0)    return false;
              if (obj.length === 0)  return true;
  
              if (typeof obj !== "object") return true;
  
              for (var key in obj) {
                  if (hasOwnProperty.call(obj, key)) return false;
              }
  
              return true;
          }
  
      function retrieveMultipleWithPromise() {
          var entityName = "privateconfiguration";
          var fieldValue = "value";
          var fieldName = "name";
          var fieldNameBaseValue = "pc_mvc_base";
          var fieldNameControllerValue = "pc_mvc_books";
          var option = "$select=" + fieldValue + "&amp;$filter=" + fieldName + " eq '" + fieldNameBaseValue + "' or " + fieldName + " eq '" + fieldNameControllerValue + "'";
  
          return new Promise(function (resolve, reject) {
              var result = SDK.REST.retrieveMultipleRecords(
                  entityName,
                  option,
                  function (result) {
                  },
                  function (error) {
                      errorHandler(error);
                  },
                  function () {
                  }
              );
              if(!(isEmpty(result))){
                  resolve(result);
              }
              else{
                  reject(result);
              }
          });
      }
  
      var iframe = Xrm.Page.getControl("IFRAME_MVCApp");
      //retrieve delle due private conf.
      var privateConfigurationPromise = retrieveMultipleWithPromise()
          .then(result =&gt; result.map(function (item) { return item.ava_value; }).join(""))
          .catch(error =&gt; console.log(error));
  
  };
  </code></pre>