ODataModel.resetChanges error: "Cannot read property 'then' of undefined"

ODataModel.resetChanges error: "Cannot read property 'then' of undefined"

我创建了一个可以从 Web 完美运行的应用程序 IDE。我将它部署到 Launchpad,当我从那里调用它时出现错误

Uncaught (in promise) TypeError: Cannot read property 'then' of undefined
at f._bindNewContext (Component-preload.js:10)
at f. (Component-preload.js:10)

_bindNewContext一定有错误:

_bindNewContext: function () {
  this.getModel().resetChanges().then(function() {
    this.oContext = this.getModel().createEntry("/Kardex01Set", {
      success: this._successSave.bind(this),
      error: this._errorSave.bind(this)
    })
  }.bind(this));
  // ... some more code
},

这个编码有错吗?从启动板调用应用程序时出现此错误的其他原因可能是什么?

v2ODataModel.resetChanges()returns一个promise only since 1.65.0.
在以前的版本中,它返回 undefined

即在 Web IDE 中,您一直在使用较新的 UI5 版本进行开发,而从 FLP 启动的应用程序使用的是旧版本,因此出现错误。