-2

I am not able to call any custom function inside the oData post success call.

onSubmit: function () { 
  var that = this; that.onInit(); 
}

oModel.create("/Entity", postData, { 
  success: function (oRetrievedResult) { 
    var that=this;
    lv_BusyDialog.close();
    var msg = 'Success!'; 
    MessageToast.show(msg);
    that.onSubmit(); 
    // This onSubmit is getting not called here. 
  }, 
  error: function (oError) { 
    /* do something */ 
    lv_BusyDialog.close();
    var msg1 = 'error'; 
    MessageToast.show(msg1);
  }
Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
Oyo
  • 1
  • 3

1 Answers1

0

Your that variable is local, so you can not access it out of the onSubmit function. You can assign this to that before oModel.create line.

mkysoft
  • 5,392
  • 1
  • 21
  • 30