Skip to Content
0
Jul 07, 2020 at 10:10 AM

submit smart form values

46 Views

hello

i need to use smart form in my project and submit one record .

i used the submitChanges in my project but it doesn't work.

i am getting the success msg but nothing is in the backend.

i am wondering if this is the right way to use smart form or not .( by using submitChanges and the CreateEntry in the init Function)

this is my init function.

	onInit: function () {


		var oProperties = {
		Title: "",
		Priority: "",
		Status: "Draft",
		Owner: "",
		};
		this.oModel = this.getOwnerComponent().getModel();
		var oContext = this.oModel.createEntry("/PropertiestSet", {
				properties: oProperties
			});
		var oSmartForm = this.getView().byId("smartForm");
		oSmartForm.setBindingContext(oContext);

		}

and this is my submitChanges function

		handleSubmit: function (oEvent) {
			this.oModel.submitChanges({
			success: this.fnSuccess,
			error: this.fnError
			});