Client BusinessObjects with async functions

  • dcyborra
        5 years ago #10199

        Hi,

        i am trying to get a client business object running in which i perform a server business object call. How can i return the async ajax result of the businnes object call?

        Mathieu Roll
            Has successfully completed the online course Introduction
            Has successfully completed the online course Intermediate (200)
            Has successfully completed the online course Advanced (300)
            Has successfully completed the online course Basics (100)
          5 years ago #10205
          Up
          0
          Down
          ::

          Hello dcyborra,

          You have to use a promise.

          For Example:

          try {
              return new Promise(function (resolve, reject) {
                  var boSuccess = function(result) {
                      resolve({outputParam: result});
                  };
                  
                  var boFail = function(result) {
                      reject({outputParam: result});
                  };
                  
                  Simplifier.BusinessObject.test_m002.getSomeListData({}, boSuccess, true, false, boFail);
              });
          } catch (e) {
              throw e;
          }
        Viewing 2 posts - 1 through 2 (of 2 total)

        You must be logged in to reply to this topic.