I am trying to call the function that closes the dialog from a sucess function, as follows:

function close onCloseDialog()
_getDialog: function () {
// create dialog lazily
if (!this._oDialog) {
// create dialog via fragment factory
this._oDialog = sap.ui.xmlfragment("mta.HealthCare.view.NuevoEPPDotacion", this);
}
return this._oDialog;
},
onCloseDialog: function () {
this._getDialog().close();
},
function of the Guardar button
...
this.oModel.create("/EPPDOT", oData, {
success: function (oCreatedEntry) {
MessageToast.show("Registro exitoso!");
this.onCloseDialog(); //close dialog
},
error: function (oError) {
MessageToast.show("Error de registro");
}
});
the registration is successful but it doesn't close the dialog, How could I do that?